Skip to content

Revert "apply borrow builder pattern to ConcatSourceMapBuilder (#366)"#370

Merged
Boshen merged 2 commits into
mainfrom
revert-concat-borrow-builder
Jun 19, 2026
Merged

Revert "apply borrow builder pattern to ConcatSourceMapBuilder (#366)"#370
Boshen merged 2 commits into
mainfrom
revert-concat-borrow-builder

Conversation

@Boshen

@Boshen Boshen commented Jun 19, 2026

Copy link
Copy Markdown
Member

Reverts #366 (and #369, which sits on top of it).

#366 switched ConcatSourceMapBuilder to borrowed &'a str storage — optimal when the input maps outlive the result. But the builder's main consumer, rolldown's SourceJoiner, feeds owned SourceMap<'static> maps and wants an owned map back. The right optimization there is owned-merge — move the owned strings into the builder (no copy) — which needs Cow storage, not &str.

This restores the original Cow<'a, str> storage so the owned-merge work can land on top (#368, mirroring the approach in #365). #369's benchmark is reverted alongside because it calls ConcatSourceMapBuilder::into_owned_sourcemap (added by #366); #368 reintroduces a superset of those benches on the restored storage.

@Boshen
Boshen merged commit 5286161 into main Jun 19, 2026
7 checks passed
@Boshen
Boshen deleted the revert-concat-borrow-builder branch June 19, 2026 14:56
@codspeed-hq

codspeed-hq Bot commented Jun 19, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 1.93%

⚡ 4 improved benchmarks
❌ 1 regressed benchmark
✅ 11 untouched benchmarks
⏩ 7 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
build_single 5.7 µs 5.8 µs -1%
from_sourcemaps 317.9 µs 305 µs +4.22%
add_sourcemap_loop 330.3 µs 322.7 µs +2.33%
lookup_table[real_small] 1.4 µs 1.3 µs +2.18%
lookup_table[real_medium] 1.5 µs 1.5 µs +1.97%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing revert-concat-borrow-builder (b8fe114) with main (8d72a6a)

Open in CodSpeed

Footnotes

  1. 7 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant