You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace rust_lapper::Lapper scope lookups in biome_js_semantic with a pre-order ScopeRangeIndex.
Scope ranges are properly nested, so the new index sorts entries by start ascending/end descending, de-duplicates identical ranges to preserve the existing behavior, and stores each entry's closest enclosing scope. Lookups use binary search followed by an enclosing-scope walk (O(log n + depth) instead of scanning all intervals). The builder-side range map and the rust-lapper dependency are removed.
The comparison reports 10 improvements, 32 unchanged benchmarks, and no regressions. Highlights include:
index_d_ts[astro_server.mjs]: 151.2 ms → 69.6 ms (×2.2)
bench_index_d_ts_salsa_end_to_end[astro_server.mjs]: 184.5 ms → 102.5 ms (+80.0%)
bench_index_d_ts_salsa_incremental_first_run: 490.5 ms → 304.9 ms (+60.9%)
A walltime run was attempted locally but could not complete: dedicated macro runners are unavailable for this repository owner, and the standard-runner LTO build was stopped before benchmark execution. The validated comparison above is CPU simulation, matching the repository's benchmark workflow mode.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
L-JavaScriptLanguage: JavaScript and super languages
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replace
rust_lapper::Lapperscope lookups inbiome_js_semanticwith a pre-orderScopeRangeIndex.Scope ranges are properly nested, so the new index sorts entries by start ascending/end descending, de-duplicates identical ranges to preserve the existing behavior, and stores each entry's closest enclosing scope. Lookups use binary search followed by an enclosing-scope walk (
O(log n + depth)instead of scanning all intervals). The builder-side range map and therust-lapperdependency are removed.Validation
cargo test -p biome_js_semanticcargo test -p biome_module_graphcargo test -p biome_js_analyzecargo clippy -p biome_js_semantic --all-targets -- -D warningscargo fmt --all -- --checkAll passed with no tracked snapshot changes.
CodSpeed comparison
Measured with the same local CPU-simulation setup on the
biome_module_graphsuite:6abb7053a300d98d548d85276abb6d5268d563499944dd0The comparison reports 10 improvements, 32 unchanged benchmarks, and no regressions. Highlights include:
index_d_ts[astro_server.mjs]: 151.2 ms → 69.6 ms (×2.2)bench_index_d_ts_salsa_end_to_end[astro_server.mjs]: 184.5 ms → 102.5 ms (+80.0%)bench_index_d_ts_salsa_incremental_first_run: 490.5 ms → 304.9 ms (+60.9%)A walltime run was attempted locally but could not complete: dedicated macro runners are unavailable for this repository owner, and the standard-runner LTO build was stopped before benchmark execution. The validated comparison above is CPU simulation, matching the repository's benchmark workflow mode.