Skip to content

perf(semantic): preserve precomputed identifier hash throughout semantic analysis#18476

Closed
Boshen wants to merge 1 commit into01-23-perf_lexer_compute_identifier_hash_incrementally_during_lexingfrom
01-24-perf_semantic_preserve_identifier_hash
Closed

perf(semantic): preserve precomputed identifier hash throughout semantic analysis#18476
Boshen wants to merge 1 commit into01-23-perf_lexer_compute_identifier_hash_incrementally_during_lexingfrom
01-24-perf_semantic_preserve_identifier_hash

Conversation

@Boshen
Copy link
Member

@Boshen Boshen commented Jan 24, 2026

  • Change symbol_names storage from Vec<Atom> to Vec<Ident> to preserve hash
  • Update create_symbol and set_symbol_name to accept Ident instead of &str
  • Use clone_in in scoping methods instead of reconstructing from &str
  • Update traverse context APIs to use Ident<'_> instead of &str
  • Optimize mangler to compute Ident once per unique name, not per symbol
  • Update all callers in transformer, minifier, and transformer_plugins

Co-Authored-By: Claude Opus 4.5 [email protected]

Copy link
Member Author

Boshen commented Jan 24, 2026

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.
Learn more


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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-hq
Copy link

codspeed-hq bot commented Jan 24, 2026

CodSpeed Performance Report

Merging this PR will not alter performance

Comparing 01-24-perf_semantic_preserve_identifier_hash (7398f9f) with 01-23-perf_lexer_compute_identifier_hash_incrementally_during_lexing (364ff6d)

Summary

✅ 42 untouched benchmarks
⏩ 3 skipped benchmarks1

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@Boshen Boshen force-pushed the 01-24-perf_semantic_preserve_identifier_hash branch 2 times, most recently from e51bb3c to d788187 Compare January 24, 2026 07:57
@Boshen Boshen force-pushed the 01-23-perf_lexer_compute_identifier_hash_incrementally_during_lexing branch from 364ff6d to db265d1 Compare January 24, 2026 11:16
@Boshen Boshen force-pushed the 01-24-perf_semantic_preserve_identifier_hash branch from 7398f9f to 6a1f84a Compare January 24, 2026 11:16
@Boshen Boshen marked this pull request as ready for review January 24, 2026 11:16
@Boshen Boshen force-pushed the 01-23-perf_lexer_compute_identifier_hash_incrementally_during_lexing branch from db265d1 to ee1560a Compare January 24, 2026 13:41
@Boshen Boshen requested a review from camc314 as a code owner January 24, 2026 13:41
@Boshen Boshen force-pushed the 01-24-perf_semantic_preserve_identifier_hash branch from 6a1f84a to b4a77e0 Compare January 24, 2026 13:41
@github-actions github-actions bot added the A-linter Area - Linter label Jan 24, 2026
@Boshen Boshen force-pushed the 01-24-perf_semantic_preserve_identifier_hash branch from b4a77e0 to 83b24ca Compare January 24, 2026 13:48
…tic analysis

- Change `symbol_names` storage from `Vec<Atom>` to `Vec<Ident>` to preserve hash
- Update `create_symbol` and `set_symbol_name` to accept `Ident` instead of `&str`
- Use `clone_in` in scoping methods instead of reconstructing from `&str`
- Update traverse context APIs to use `Ident<'_>` instead of `&str`
- Use `Ident::new_const` for compile-time constant strings ("module", "Object")
- Use `Ident::from(Atom)` instead of `Ident::from(atom.as_str())`
- Modify `base54` to compute hash incrementally while building name, returning `Ident` directly
- Update mangler to use `Ident` throughout, eliminating rehashing of mangled names

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter A-minifier Area - Minifier A-semantic Area - Semantic A-transformer Area - Transformer / Transpiler C-performance Category - Solution not expected to change functional behavior, only performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments