Skip to content

perf: speed up swc_ecma_codegen JsWriter hot path#11870

Draft
hardfist wants to merge 5 commits into
swc-project:mainfrom
hardfist:codex/ecma-codegen-10pct-speedup
Draft

perf: speed up swc_ecma_codegen JsWriter hot path#11870
hardfist wants to merge 5 commits into
swc-project:mainfrom
hardfist:codex/ecma-codegen-10pct-speedup

fix(ecma_codegen): remove stale srcmap hash dedupe path

9ac84bc
Select commit
Loading
Failed to load commit list.
CodSpeed HQ / CodSpeed Performance Analysis succeeded May 20, 2026 in 0s

Performance Gate Passed

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 19 improved benchmarks
✅ 200 untouched benchmarks
⏩ 31 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
es/oxc/benches/assets/table.tsx/sourceMap=true/reactDev=false 7.3 ms 7.2 ms +2.38%
es/oxc/benches/assets/table.tsx/sourceMap=true/reactDev=true 8.1 ms 7.9 ms +2.73%
es/large/codegen/es2015 33.9 ms 28.9 ms +17.53%
es/large/codegen/es2016 33.9 ms 28.9 ms +17.61%
es/large/codegen/es2017 34 ms 28.8 ms +18.07%
es/large/codegen/es2018 34 ms 28.9 ms +17.67%
es/large/codegen/es2019 33.9 ms 28.9 ms +17.67%
es/large/codegen/es2020 34 ms 28.9 ms +17.63%
es/large/codegen/es3 33.9 ms 28.8 ms +17.66%
es/large/codegen/es5 33.9 ms 28.9 ms +17.63%
es/oxc/benches/assets/parser.ts/sourceMap=true/reactDev=false 83.5 ms 81.5 ms +2.37%
es/oxc/benches/assets/parser.ts/sourceMap=true/reactDev=true 83.5 ms 81.5 ms +2.43%
es/oxc/benches/assets/renderer.ts/sourceMap=true/reactDev=false 13.6 ms 13.3 ms +2.31%
es/oxc/benches/assets/renderer.ts/sourceMap=true/reactDev=true 13.6 ms 13.3 ms +2.37%
es/oxc/benches/assets/UserSettings.tsx/sourceMap=true/reactDev=false 1.2 ms 1.2 ms +2.14%
es/codegen/with-parser/colors 149.9 µs 145.4 µs +3.13%
es/codegen/colors 71.9 µs 68 µs +5.72%
es/codegen/large 641.5 µs 556.1 µs +15.35%
es/codegen/with-parser/large 1,062.7 µs 976.7 µs +8.8%

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing hardfist:codex/ecma-codegen-10pct-speedup (9ac84bc) with main (aa5b539)

Open in CodSpeed

Footnotes

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