Avatar for the oxc-project user
oxc-project
sort-package-json
BlogDocsChangelog

Performance History

Latest Results

chore(deps): update rust crate serde_json to v1.0.150 (#105) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
main
1 day ago
chore(deps): update github actions
renovate/github-actions
15 days ago
chore: release v0.0.13
release-plz-2026-05-08T12-07-16Z
18 days ago
chore: release v0.0.13
release-plz-2026-05-08T12-07-16Z
18 days ago
refactor: trim output allocations and unify unknown-field sort (#96) * refactor: trim output allocations and unify unknown-field sort Stream output into a single byte buffer (BOM bytes prepended, serde_json appends, one `from_utf8_unchecked` at the end) instead of building a String, pushing '\n', and re-allocating to prepend the BOM. Saves a full output-sized memcpy on BOM inputs and the post-serialize UTF-8 walk in general. Collapse `non_private` and `private` into a single `unknown` Vec sorted by `(starts_with('_'), name)` — one allocation, one sort, and the underscore check leaves the per-entry hot path. Replace `sort_object_by_key_order`'s `obj.sort_keys()` + per-key `shift_remove` (each shift moves the IndexMap tail) with a single-pass classify into a slot Vec + remainder, then merge. cargo bench (vs. main): sort already sorted package.json: -6.06% sort large package.json: -4.36% Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * perf: pad output Vec capacity to absorb trailing newline `Vec::with_capacity(input.len())` was sized to fit the JSON body exactly when the input is already pretty-printed, so the trailing `buf.push(b'\n')` would always trip a reallocation. For the minimal benchmark (~77 byte input) this caused a measurable regression (CodSpeed reported +13.83%) — `to_string_pretty` previously used serde's default 128-byte capacity, which had the headroom we lacked. Pad the capacity by 16 bytes so the newline push never realloc's, while still keeping the win for larger inputs where the hint avoids serde's repeated 128 → 256 → 512 → … growth. cargo bench (vs. main): sort small package.json: -3.08% sort already sorted package.json: -4.34% sort minimal package.json: -1.35% sort large package.json: -1.37% Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
main
18 days ago

Latest Branches

CodSpeed Performance Gauge
0%
chore(deps): update rust crate serde_json to v1.0.150#105
1 day ago
c1712d7
renovate/rust-crates
CodSpeed Performance Gauge
0%
CodSpeed Performance Gauge
0%
18 days ago
8cf9b93
release-plz-2026-05-08T12-07-16Z
© 2026 CodSpeed Technology
Home Terms Privacy Docs