Avatar for the swc-project user
swc-project
swc
BlogDocsChangelog

Performance History

Latest Results

perf: Optimize Atom equality (#11902) <!-- Note: CI script will automatically rebase your PR so please do not rebase unless required --> <!-- Thanks for submitting a pull request! Please provide enough information so that others can review your pull request. --> **Description:** This PR optimizes `Atom` equality checks in `hstr` and `swc_atoms` without adding benchmark files. Changes: - Inline the `PartialEq` fast path for `hstr::Atom` and `Wtf8Atom` instead of forcing `#[inline(never)]`. - Return `false` immediately for non-identical inline atoms, because inline atoms encode both length and bytes in the tagged value. - Keep dynamic atom equality correct across different `AtomStore`s by preserving the hash + slice fallback. - Hand-write `swc_atoms::Atom` `PartialEq` / `Hash` wrapper impls and inline wrapper equality helpers. - Add equality coverage to existing unit tests. Local CodSpeed simulation was used with a temporary equality benchmark before removing the benchmark from this PR. Representative results: | Benchmark | Accesses | Δ | Estimated cycles | Δ | |---|---:|---:|---:|---:| | `hstr::Atom inline/equal` | 24 → 14 | -41.7% | 549 → 434 | -20.9% | | `hstr::Atom inline/different` | 40 → 24 | -40.0% | 670 → 549 | -18.1% | | `hstr::Atom dynamic/same-store/equal` | 24 → 14 | -41.7% | 549 → 434 | -20.9% | | `hstr::Atom dynamic/other-store/equal` | 73 → 62 | -15.1% | 1438 → 1217 | -15.4% | | `hstr::Atom dynamic/different` | 37 → 29 | -21.6% | 877 → 764 | -12.9% | | `swc_atoms::Atom inline/equal` | 24 → 14 | -41.7% | 549 → 434 | -20.9% | | `swc_atoms::Atom dynamic/other-store/equal` | 73 → 62 | -15.1% | 1753 → 1322 | -24.6% | | `swc_atoms::Atom dynamic/equal-atom-macro` | 107 → 96 | -10.3% | 2102 → 1566 | -25.5% | Validation: - `git submodule update --init --recursive` - `cargo fmt --all --check` - `cargo test -p hstr` - `cargo test -p hstr --features serde` - `cargo test -p swc_atoms` - `cargo clippy --all --all-targets -- -D warnings` **BREAKING CHANGE:** No breaking change. **Related issue (if exists):** N/A --------- Co-authored-by: DongYun Kang <kdy.1997.dev@gmail.com>
main
10 hours ago
chore: Add changeset for atom equality optimization
hardfist:perf/optimize-atom-eq
11 hours ago
perf: optimize atom equality
hardfist:perf/optimize-atom-eq
11 hours ago
perf: optimize atom equality
hardfist:perf/optimize-atom-eq
12 hours ago
revert(es/decorators): revert decorator initializer ordering
kdy1/revert-11847-helper-regression
13 hours ago
chore: start keyword hashing optimization
hardfist:perf/perfect-keyword-hashing
1 day ago

Latest Branches

CodSpeed Performance Gauge
+2%
perf: Optimize Atom equality#11902
11 hours ago
d790b90
hardfist:perf/optimize-atom-eq
CodSpeed Performance Gauge
0%
14 hours ago
3273a08
kdy1/revert-11847-helper-regression
CodSpeed Performance Gauge
0%
fix(es/resolver): Merge re-opened TypeScript namespace scopes#11872
5 days ago
7aa055b
MavenRain:fix/resolver-namespace-merge
© 2026 CodSpeed Technology
Home Terms Privacy Docs