perf(semantic): compute identifier hash incrementally during lexing#18454
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
CodSpeed Performance ReportMerging this PR will degrade performance by 20.46%Comparing Summary
Performance Changes
Footnotes
|
86d7486 to
dca2b3b
Compare
1a13ac9 to
a25cdb3
Compare
2abd0b1 to
364ff6d
Compare
1c918ed to
6d1cc47
Compare
e4e672d to
364ff6d
Compare
6d1cc47 to
fc67309
Compare
364ff6d to
db265d1
Compare
Add incremental hashing to the lexer so identifier hashes are computed while scanning bytes, avoiding a second pass over the data. - Add `identifier_hasher` field to `Lexer` and `LexerCheckpoint` - Add `hash_identifier: true` variant to `byte_search!` macro - Update `identifier_name_handler` to hash first byte and use hashing variant - Handle unicode/escape cold paths with appropriate hashing - Update `get_ident()` to use `Ident::new_with_hash()` with precomputed hash - Re-export `IncrementalIdentHasher` from `oxc_span` Co-Authored-By: Claude Opus 4.5 <[email protected]>
fc67309 to
ece98da
Compare
db265d1 to
ee1560a
Compare

Add incremental hashing to the lexer so identifier hashes are computed
while scanning bytes, avoiding a second pass over the data.
identifier_hasherfield toLexerandLexerCheckpointhash_identifier: truevariant tobyte_search!macroidentifier_name_handlerto hash first byte and use hashing variantget_ident()to useIdent::new_with_hash()with precomputed hashIncrementalIdentHasherfromoxc_spanCo-Authored-By: Claude Opus 4.5 [email protected]