Skip to content

add unicode dense benchmark - #264

Merged
samuelcolvin merged 1 commit into
mainfrom
add-unicode-dense-bench
Aug 18, 2026
Merged

samuelcolvin merged 1 commit into
mainfrom
add-unicode-dense-bench

Conversation

@samuelcolvin

Copy link
Copy Markdown
Member

No description provided.

@codecov

codecov Bot commented Aug 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@codspeed

codspeed Bot commented Aug 17, 2026 •

Copy link
Copy Markdown

Merging this PR will degrade performance by 14.05%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

❌ 3 regressed benchmarks
✅ 67 untouched benchmarks
🆕 4 new benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
❌ massive_ints_array_jiter_iter 564.1 µs 685.2 µs -17.67%
❌ massive_ints_array_jiter_value 743 µs 846.5 µs -12.24%
❌ python_parse_massive_ints_array 1.1 ms 1.3 ms -12.13%
🆕 unicode_dense_jiter_iter N/A 3.3 µs N/A
🆕 unicode_dense_jiter_skip N/A 2 µs N/A
🆕 unicode_dense_jiter_value N/A 3.6 µs N/A
🆕 unicode_dense_serde_value N/A 4.2 µs N/A

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing add-unicode-dense-bench (a3c9031) with main (785cf75)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (ced827c) during the generation of this report, so 785cf75 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

@samuelcolvin

Copy link
Copy Markdown
Member Author

@codspeedbot the code didn't change meaningfully, why did the benchmarks move so far?

@codspeed

codspeed Bot commented Aug 17, 2026 •

Copy link
Copy Markdown

@codspeedbot the code didn't change meaningfully, why did the benchmarks move so far?

You're right that the diff isn't responsible — the three regressions come from a dependency upgrade, not from this PR.

What actually changed: the repo has no committed Cargo.lock, so the bench job resolves dependencies fresh on every run. The base run on main is from June 29 and this PR's run is from Aug 17, and in between num-bigint moved from 0.4.6 → 0.4.8. That's visible directly in the flamegraph origins: base frames are attributed to num-bigint@0.4.6, head frames to num-bigint@0.4.8 (the Rust toolchain also differs between the two runs).

Where the time goes: in IntParse::parse, the bigint accumulation loop got more expensive. num_bigint::biguint::multiplication::scalar_mul goes from 74.7 µs total on base to 235.4 µs on head, because on 0.4.8 the limb vector is grown one element at a time inside scalar_mul (RawVec::grow_one → realloc, 134.7 µs) instead of being allocated up front in the From<u64> conversion path. Everything else in the benchmark is unchanged, which is why massive_ints_array_jiter_skip (never parses the digits) and massive_ints_array_serde_value (serde_json falls back to f64 for these) are untouched.

Confirmation: I reproduced this locally under codspeed run --mode simulation, on one machine with one toolchain, changing only the num-bigint version:

Benchmark local 0.4.6 local 0.4.8 CI base CI head
massive_ints_array_jiter_iter 566.4 µs 684.9 µs 564.1 µs 685.1 µs
massive_ints_array_jiter_value 742.7 µs 847.0 µs 743 µs 847.7 µs
short_numbers_jiter_value 140.0 µs 158.1 µs 140.0 µs 155.6 µs

The local numbers land on the CI base/head values almost exactly, so the dependency bump accounts for the entire delta. bigints_array_jiter_value shifted the same way (189.2 → 204.2 µs) but stayed under the alert threshold.

Two side notes:

  • The "different runtime environments" warning on the report is real (base ran on an Intel Xeon, head on an AMD EPYC) but it isn't the cause here — the local reproduction on identical hardware shows the same gap.
  • The unicode_dense numbers this PR adds are unaffected by any of this.

The code change in parse.rs (byte-array literals rewritten as *b"...") produces identical bytes and doesn't touch number parsing, so nothing in this PR needs fixing.

If you'd like the comparisons to stop drifting like this, the fix is to make the bench job's dependency resolution reproducible — committing a Cargo.lock (or pinning one for the bench job only) would do it. Happy to open that as a follow-up PR if you want it. Otherwise, you can just acknowledge these three on CodSpeed; the next main run will re-baseline them on 0.4.8.

Summary
  • Warming up the performance wizard...
  • Investigating reported regressions — Reproduced locally: the 3 regressions come from a num-bigint 0.4.6 -> 0.4.8 upgrade, not from the PR
  • Handling comment — Comment handling finished successfully

Learnings updated. See what CodSpeed remembers about this repository.

Was this response helpful? React with 👍 or 👎 to help us improve CodSpeedBot.

samuelcolvin added a commit that referenced this pull request Aug 18, 2026
The nightly test job failed in `cargo llvm-cov` with "failed to collect
object files ... target/llvm-cov-target/debug". rustc 1.100.0-nightly
(2026-08-17) uses Cargo's new build-dir layout, which cargo-llvm-cov
0.8.5 does not know about, so it looks for object files where there are
none. 0.9.0 handles the new layout.

install-action resolves `cargo-llvm-cov` from a manifest baked into its
release: v2.71.3 (April) pins latest to 0.8.5, v2.86.3 pins it to 0.9.0.

Reproduced on rustc 1.100.0-nightly (8fa1c96cf 2026-08-17): 0.8.5 fails
with that error, 0.9.0 writes a valid codecov.json.

This break is not from committing Cargo.lock; it also fails on main and
on #264.
@samuelcolvin
samuelcolvin force-pushed the add-unicode-dense-bench branch from 580b8a9 to a3c9031 Compare August 18, 2026 20:25
@samuelcolvin
samuelcolvin enabled auto-merge (squash) August 18, 2026 20:30
@samuelcolvin
samuelcolvin merged commit 5360128 into main Aug 18, 2026
28 of 29 checks passed
@samuelcolvin
samuelcolvin deleted the add-unicode-dense-bench branch August 18, 2026 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant