oxc-project
oxc-sourcemap
Blog
Docs
Changelog
Blog
Docs
Changelog
Overview
Branches
Benchmarks
Runs
Performance History
Latest Results
feat(sourcemap): add into_parts / from_parts for allocation-free transforms Add `SourceMapParts<'a>` — a destructured form of `SourceMap<'a>` that exposes its owned `Cow<'a, str>` fields. Returned by `SourceMap::into_parts`, consumed by `SourceMap::from_parts` / `From<SourceMapParts>`. Use case: downstream code that wants to *transform* a sourcemap (rewrite tokens, swap in a different `file`, drop `token_chunks`) without going through string accessors. The previous API only exposed `&str` views, which forced a clone of every name / source / sourcesContent string when the caller wanted to take ownership and reassemble. With `into_parts`, that becomes a `Vec<Cow<'a, str>>` move — zero per-string allocations. Pairs naturally with `set_file` / `set_sources` etc. for in-place mutation when the caller only needs to change one field.
perf/decode-borrowed-deserialization
2 hours ago
feat(sourcemap): add SourceMap::into_owned helper Allocate owned copies of every borrowed string in a `SourceMap` so that the result is `SourceMap<'static>`, detached from the original JSON input buffer (or from a concat builder's input lifetime). Discovered while linking the new lifetime-parameterized SourceMap into downstream consumers (oxc, rolldown). Several places need a concat or parse result to outlive its source data: the previous Arc-based API let them share cheaply, the new Cow-based API needs an explicit copy step. `into_owned` is that step.
perf/decode-borrowed-deserialization
2 hours ago
fix(decode): restore required fields in BorrowedJSONSourceMap Removed the `#[serde(default)]` attributes I'd added to fields that the sourcemap spec actually requires (`sources`, `mappings`, etc.), so malformed JSON missing those fields now errors out as it does on main. Only `names` keeps `#[serde(default)]`, matching the original `JSONSourceMap` shape. Restores the `sourcesMissing` tc39 spec test.
perf/decode-borrowed-deserialization
3 hours ago
[autofix.ci] apply automated fixes
perf/decode-borrowed-deserialization
3 hours ago
perf(concat): hoist per-token chunk state out of the per-iteration closure `add_sourcemap`'s per-token loop captured `&mut self` inside the `get_source_id().map(...)` / `get_name_id().map(...)` closures so it could update `token_chunk_prev_source_id` / `token_chunk_prev_name_id` on every iteration. That forced the compiler to round-trip the prev_* fields through memory (load, mutate, store via the `self` pointer) for every token rather than keeping them in registers. Track the running prev values in plain locals, then write them back to `self` once at the end. Also handle the first token separately so the `i == 0` dedup check no longer runs every iteration. Behavior, including the duplicate-token de-duplication at the concatenation seam, is unchanged.
perf/concat-hoist-state
4 hours ago
perf(decode): inline VLQ segment parser and skip capacity pre-pass Two micro-optimizations to `decode_mapping`: 1. Drop the upfront `,` / `;` counting pass that pre-sized the token `Vec` to an exact upper bound. Replace it with a `mapping.len() / 3` heuristic: real-world segments are 3-5 bytes, so this slightly over-allocates without paying for the extra full scan of the input. 2. Inline `parse_vlq_segment_into` into the outer match arm and use a local `local_cursor` (copied to/from the surrounding cursor at segment boundaries). With cursor state and the `nums` array visible at the function scope the optimizer can keep them in registers across iterations, and the function-call + reborrow overhead per segment is gone. `get_unchecked` is used for the `mapping[cursor]` reads — every load is preceded by an explicit length check, so the bounds checks are already provably redundant. Behavior, error variants, and the public API are unchanged.
perf/decode-inline-vlq
4 hours ago
[autofix.ci] apply automated fixes
perf/decode-borrowed-deserialization
4 hours ago
chore: release v6.1.2
release-plz-2026-05-25T05-39-38Z
4 hours ago
Latest Branches
CodSpeed Performance Gauge
+6%
perf!: borrow strings in SourceMap, drop Arc<str>
#329
2 hours ago
e26b447
perf/decode-borrowed-deserialization
CodSpeed Performance Gauge
+3%
perf(concat): hoist per-token chunk state out of the per-iteration closure
#331
4 hours ago
15efed1
perf/concat-hoist-state
CodSpeed Performance Gauge
+3%
perf(decode): inline VLQ segment parser and skip capacity pre-pass
#330
4 hours ago
a901059
perf/decode-inline-vlq
© 2026 CodSpeed Technology
Home
Terms
Privacy
Docs