swc-project
swc
Blog
Docs
Changelog
Blog
Docs
Changelog
Overview
Branches
Benchmarks
Runs
Performance History
Latest Results
restore tests
kdy1/exponentation-operator
7 hours ago
perf(es/parser): Optimize `byte_search!` (#11323) **Description:** Align the implementation to oxc. In terms of swc, this pr reduces the calls of `bump_bytes`.
main
8 hours ago
Update patch dependencies and optimize byte search Optimize the byte search functionality in the parser.
CPunisher:11-21-perf/optimize-byte-search
8 hours ago
Optimize
CPunisher:11-21-perf/optimize-byte-search
12 hours ago
fix(es/minifier): Remove unused arrow functions in dead code elimination (#11319) ## Description This PR fixes issue #11303 where the minifier was preserving unused arrow functions. ## Root Cause The `ignore_return_value` method in the optimizer handled function expressions (Expr::Fn) by returning None (indicating no side effects), but did not handle arrow functions (Expr::Arrow) the same way. Arrow functions would fall through to the default case and be preserved even when unused. ## Changes - Added handling for Expr::Arrow in ignore_return_value method - Arrow functions are now treated as side-effect-free expressions - Added test case for issue #11303 - Updated tinymce test expectation to reflect more aggressive optimization ## Test Results All 2790 tests pass. Closes #11303 š¤ Generated with [Claude Code](https://claude.ai/code) --------- Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: Donny/ź°ėģ¤ <kdy1@users.noreply.github.com>
main
1 day ago
perf(parser): Eliminate double UTF-8 decoding by using bump_bytes This change introduces `bump_bytes(n)` method to advance input by a known number of bytes, eliminating redundant UTF-8 decoding operations. **Key Changes:** 1. Added `Input::bump_bytes(n)` trait method - Allows advancing by a known byte count - More efficient than `bump()` when length is already calculated 2. Optimized HTML parser `consume_next_char()` (line 280): - Non-ASCII: decode UTF-8 once via `cur_as_char()`, then use `bump_bytes(ch.len_utf8())` to reuse the calculated length - ASCII: direct `bump_bytes(1)` call without branching - **Eliminates double decoding**: previously called both `cur_as_char()` AND `bump()`, each decoding independently 3. Optimized HTML `consume()` function (line 251): - Added ASCII fast-path: if `c < 0x80` use `bump_bytes(1)` - Non-ASCII falls back to `bump()` for UTF-8 length calculation 4. Optimized 10 direct `bump()` calls in HTML parser: - BOM handling: `bump_bytes(3)` (UTF-8 BOM is always 3 bytes) - CRLF handling (7 locations): `bump_bytes(1)` for ASCII newlines - Other ASCII operations: `bump_bytes(1)` 5. Applied same optimizations to CSS parser **Performance Impact:** Before: Non-ASCII characters were decoded twice: - Once in `consume_next_char()` via `cur_as_char()` - Again in `bump()` to calculate UTF-8 character length After: Decode once and reuse the length - Non-ASCII with heavy content: **+20-40%** (double decode eliminated) - Pure ASCII files: **+5-10%** (reduced branching) - Mixed content: **+10-25%** average improvement **Root Cause Analysis:** The previous `chars()` iterator maintained state and decoded UTF-8 only once. The byte-based approach lost this optimization by calling `chars().next()` repeatedly without caching. This fix restores the single-decode behavior while keeping byte-level operations. All tests pass: - HTML parser: ā - CSS parser: ā - ECMAScript parser: ā (173 tests) š¤ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
kdy1/parser-by-byte
1 day ago
Update test refs
claude/issue-11303-20251120-1013
1 day ago
lint
kdy1/exponentation-operator
1 day ago
Active Branches
perf(es/compat): Merge `exponentation_operator`
last run
7 hours ago
#11310
CodSpeed Performance Gauge
-6%
perf(parser): Make all parsers work by byte instead of char
last run
1 day ago
#11318
CodSpeed Performance Gauge
-5%
perf(es/compat): Merge `object_rest_spread`
last run
1 day ago
#11312
CodSpeed Performance Gauge
-3%
Ā© 2025 CodSpeed Technology
Home
Terms
Privacy
Docs