oxc-project
oxc
BlogDocsChangelog

perf(codegen): faster splitting comments into lines

#13190Merged
Comparing
08-18-perf_codegen_faster_splitting_comments_into_lines
(
e3bfff1
) with
main
(
ada4e84
)
CodSpeed Performance Gauge
0%
Untouched
34

Benchmarks

Passed

codegen[react.development.js]
tasks/benchmark/benches/codegen.rs::codegen::bench_codegen
CodSpeed Performance Gauge
+1%
1.9 ms1.9 ms
minifier[cal.com.tsx]
tasks/benchmark/benches/minifier.rs::minifier::bench_minifier
CodSpeed Performance Gauge
+1%
30.2 ms29.9 ms
minifier[binder.ts]
tasks/benchmark/benches/minifier.rs::minifier::bench_minifier
CodSpeed Performance Gauge
0%
3.7 ms3.7 ms
semantic[RadixUIAdoptionSection.jsx]
tasks/benchmark/benches/semantic.rs::semantic::bench_semantic
CodSpeed Performance Gauge
0%
76.9 µs76.7 µs
formatter[react.development.js]
tasks/benchmark/benches/formatter.rs::formatter::bench_formatter
CodSpeed Performance Gauge
0%
11.1 ms11.1 ms
codegen[binder.ts]
tasks/benchmark/benches/codegen.rs::codegen::bench_codegen
CodSpeed Performance Gauge
0%
4.1 ms4.1 ms
formatter[RadixUIAdoptionSection.jsx]
tasks/benchmark/benches/formatter.rs::formatter::bench_formatter
CodSpeed Performance Gauge
0%
342.4 µs341.8 µs
codegen[RadixUIAdoptionSection.jsx]
tasks/benchmark/benches/codegen.rs::codegen::bench_codegen
CodSpeed Performance Gauge
0%
119.8 µs119.6 µs
formatter[binder.ts]
tasks/benchmark/benches/formatter.rs::formatter::bench_formatter
CodSpeed Performance Gauge
0%
21.6 ms21.6 ms
minifier[react.development.js]
tasks/benchmark/benches/minifier.rs::minifier::bench_minifier
CodSpeed Performance Gauge
0%
2.1 ms2.1 ms
linter[react.development.js]
tasks/benchmark/benches/linter.rs::linter::bench_linter
CodSpeed Performance Gauge
0%
52.3 ms52.3 ms
transformer[cal.com.tsx]
tasks/benchmark/benches/transformer.rs::transformer::bench_transformer
CodSpeed Performance Gauge
0%
26.4 ms26.4 ms
isolated-declarations[vue-id.ts]
tasks/benchmark/benches/transformer.rs::transformer::bench_isolated_declarations
CodSpeed Performance Gauge
0%
57.3 ms57.3 ms
codegen[cal.com.tsx]
tasks/benchmark/benches/codegen.rs::codegen::bench_codegen
CodSpeed Performance Gauge
0%
33.9 ms33.9 ms
transformer[react.development.js]
tasks/benchmark/benches/transformer.rs::transformer::bench_transformer
CodSpeed Performance Gauge
0%
717.7 µs717.7 µs
lexer[binder.ts]
tasks/benchmark/benches/lexer.rs::lexer::bench_lexer
CodSpeed Performance Gauge
0%
870.2 µs870.1 µs
lexer[react.development.js]
tasks/benchmark/benches/lexer.rs::lexer::bench_lexer
CodSpeed Performance Gauge
0%
356.6 µs356.6 µs
parser[cal.com.tsx]
tasks/benchmark/benches/parser.rs::parser::bench_parser
CodSpeed Performance Gauge
0%
26.7 ms26.7 ms
lexer[cal.com.tsx]
tasks/benchmark/benches/lexer.rs::lexer::bench_lexer
CodSpeed Performance Gauge
0%
5.3 ms5.3 ms
linter[binder.ts]
tasks/benchmark/benches/linter.rs::linter::bench_linter
CodSpeed Performance Gauge
0%
146.6 ms146.6 ms
lexer[RadixUIAdoptionSection.jsx]
tasks/benchmark/benches/lexer.rs::lexer::bench_lexer
CodSpeed Performance Gauge
0%
19.9 µs19.9 µs
estree[checker.ts]
tasks/benchmark/benches/parser.rs::parser::bench_estree
CodSpeed Performance Gauge
0%
104.5 ms104.5 ms
formatter[cal.com.tsx]
tasks/benchmark/benches/formatter.rs::formatter::bench_formatter
CodSpeed Performance Gauge
0%
179.4 ms179.4 ms
linter[RadixUIAdoptionSection.jsx]
tasks/benchmark/benches/linter.rs::linter::bench_linter
CodSpeed Performance Gauge
0%
2.5 ms2.5 ms
parser[react.development.js]
tasks/benchmark/benches/parser.rs::parser::bench_parser
CodSpeed Performance Gauge
0%
1.3 ms1.3 ms
linter[cal.com.tsx]
tasks/benchmark/benches/linter.rs::linter::bench_linter
CodSpeed Performance Gauge
0%
1.2 s1.2 s
parser[binder.ts]
tasks/benchmark/benches/parser.rs::parser::bench_parser
CodSpeed Performance Gauge
0%
3.3 ms3.3 ms
semantic[react.development.js]
tasks/benchmark/benches/semantic.rs::semantic::bench_semantic
CodSpeed Performance Gauge
0%
1.7 ms1.7 ms
semantic[cal.com.tsx]
tasks/benchmark/benches/semantic.rs::semantic::bench_semantic
CodSpeed Performance Gauge
0%
27.9 ms27.9 ms
semantic[binder.ts]
tasks/benchmark/benches/semantic.rs::semantic::bench_semantic
CodSpeed Performance Gauge
0%
4.3 ms4.3 ms
transformer[binder.ts]
tasks/benchmark/benches/transformer.rs::transformer::bench_transformer
CodSpeed Performance Gauge
0%
1.7 ms1.7 ms
minifier[RadixUIAdoptionSection.jsx]
tasks/benchmark/benches/minifier.rs::minifier::bench_minifier
CodSpeed Performance Gauge
0%
58.5 µs58.6 µs
parser[RadixUIAdoptionSection.jsx]
tasks/benchmark/benches/parser.rs::parser::bench_parser
CodSpeed Performance Gauge
0%
83.7 µs83.8 µs
transformer[RadixUIAdoptionSection.jsx]
tasks/benchmark/benches/transformer.rs::transformer::bench_transformer
CodSpeed Performance Gauge
0%
133.2 µs133.5 µs

Commits

Click on a commit to change the comparison range
Base
main
ada4e84
+0.08%
perf(codegen): faster splitting comments into lines (#13190) Follow-on after #13169. Implement the first optimization mentioned in https://github.com/oxc-project/oxc/pull/13169#issuecomment-3196080841. Iterate over string byte-by-byte rather than char-by-char. It's amazing how bad Rust is at string operations. I tried it without unsafe code at first, but Rust inserts checks for whether a slice falls on a UTF-8 char boundary on every single operation, even though it's obvious from the context that these checks can never fail. It made the assembly x4 longer, which is no good as this is meant to be a tight loop.
e3bfff1
3 months ago
by overlookmotel
© 2025 CodSpeed Technology
Home Terms Privacy Docs