Repository navigation
perf(javascript): index source-map ignore lists per leaf - #1905
Merged
morluto merged 1 commit intoOct 11, 2026
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
3 tasks done
Owner
|
Thanks for the source-map optimization, @cyanseek. Building the ignore-list Set once for each projected leaf removes a repeated scan per source while preserving existing output. Your regression covers duplicate source identities and standard-versus-legacy ignore-list precedence. We’re glad to have you contributing to REA. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Index source-map ignore lists once per leaf instead of scanning the entire list for every source declaration. This removes quadratic work from
trace-web-source-location/trace_web_source_locationwhile preserving their complete Evidence.Problem and expected behavior
inspectSourceMapValuecurrently callsincludes(sourceIndex)for each source. Maps with many third-party sources therefore spend O(sources × ignore-list entries) work just assigningignored, even when tracing a single generated point. Ignore lists are used by real bundlers to identify vendor/framework sources (Angular/Chrome example).On base
7c207c7, a generated 3,777,849-byte map with 200,000 sources and ignore-list entries takes about 10 seconds through the public CLI. It is within the existing 4 MiB and 262,144-record limits. This PR addresses that independently reproduced cost; it does not claim to resolve the broader #1065 roadmap.Change and scope
Setonly when projecting declarations. The browser-collection profile still skips declaration projection.ignoreList, and fallback tox_google_ignoreListwhen the standard field is absent.Contract and boundary impact
SourceMapFormat.ts.Evidence and regression coverage
Three alternating baseline/candidate pairs per generated input, fresh processes, Windows x64 / Node 24.18.0 / npm 11.16.0. The baseline and candidate share the same complete build except for the changed compiled module. Values below are medians, in milliseconds:
These are capacity workloads, not measurements of an Angular application. The small case has no meaningful end-to-end improvement. Each query pays this cost once; the table does not multiply local savings by a hypothetical call count.
Reproducible map construction (
nselects the table row):Trace generated position
{ line: 1, column: 0 }against a retained script containinggenerated, with the explicitly selected local map and URL contexthttps://app.test/app.js.map. DirectinspectSourceMap(text)measures the declaration-inspection column; the CLI column includes startup, artifact acquisition, the actual owned codec, and complete output delivery.Full inspected-structure and complete CLI Evidence hashes match for every baseline/candidate pair.
Actual stdio MCP and CLI outputs match on both revisions for the 200,000-source map, a 200,000-source map without an ignore list, and the unchanged published
lossless-json@4.3.1UMD source map (44,946 bytes). MCP text/structured output matches; subsequent ping succeeds; clients and transports are closed with awaited cleanup.Added a semantic regression covering duplicate source URLs with different ignored states, duplicate ignore entries, independent section indexes, legacy fallback, and explicit-empty precedence. It preserves existing semantics rather than asserting fragile wall-clock thresholds.
Representative output remains a mapped
m0.tssource withignored: trueand explicitly unavailable embedded content for the generated cases.Remaining proof gaps: no workload-frequency estimate or whole-application speedup claim; no Linux/macOS/Bun timing or live-browser capture claim.
Observed, derived, and inferred claims remain distinguishable.
Artifact identity, source provenance, and failed attempts remain preserved.
Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.
Validation performed
npm run build:cached— passed.npm run test:focused -- src/javascript/sourceMaps/TraceSourceMap.test.ts src/application/WebSourceLocationService.test.ts tests/boundary/javascript/sourceMapDecoder.test.ts tests/boundary/mcp/webSourceLocationMcp.test.ts tests/acceptance/webSourceLocationCli.test.ts tests/boundary/browser/webSourceMapFetcher.test.ts tests/boundary/browser/webSourceMapNestedCoordinates.test.ts tests/boundary/filesystem/webSourceLocationArtifacts.test.ts— 145 tests passed across 8 files, including the real Windows owned codec and public CLI/MCP workflow.npm run check— passed, including architecture guards.git diff --check— passed.Compatibility, safety, and release
Review checklist
type(scope): outcome.