about summary refs log tree commit diff
path: root/src/test/codegen/src-hash-algorithm
diff options
context:
space:
mode:
authorAleksey Kladov <aleksey.kladov@gmail.com>2021-11-27 20:50:07 +0300
committerAleksey Kladov <aleksey.kladov@gmail.com>2021-12-05 15:32:39 +0300
commitc603b9043fd530c11d3001eb62b1315c5aa1afe0 (patch)
tree776f0196c5fb5eaff1b9ad2e9bf5cea0f5b89d8f /src/test/codegen/src-hash-algorithm
parentb519a179b456c24dc8bcb675c2af6c0fd0733c29 (diff)
downloadrust-c603b9043fd530c11d3001eb62b1315c5aa1afe0.tar.gz
rust-c603b9043fd530c11d3001eb62b1315c5aa1afe0.zip
feat: make hightlighting linear
In https://youtu.be/qvIZZf5dmTE, we've noticed that AstIdMap does a
linear lookup when going from SyntaxNode to Id. This leads to
accidentally quadratic overall performance. Replace linear lookup with a
O(1) hashmap lookup.

Future work: don't duplicate `SyntaxNodePtr` in `AstIdMap` and switch to
"call site dependency injection" style storage (eg, store a
`HashSet<ErasedFileAstId>`).

See the explanation of the work here on YouTube
https://youtu.be/wvEgymUm7cY :-)
Diffstat (limited to 'src/test/codegen/src-hash-algorithm')
0 files changed, 0 insertions, 0 deletions