Skip to content

bench: improve simple benchmark representativeness#266

Merged
Boshen merged 1 commit intomainfrom
chore/benchmark-simple-fixtures
Feb 8, 2026
Merged

bench: improve simple benchmark representativeness#266
Boshen merged 1 commit intomainfrom
chore/benchmark-simple-fixtures

Conversation

@Boshen
Copy link
Member

@Boshen Boshen commented Feb 8, 2026

Summary

  • refactor benches/simple.rs into grouped benchmarks for parse, serialize, lookup table, builder, and concat workflows
  • add fixture-driven benchmark inputs from tests/fixtures/perf/*.map
  • use black_box around benchmark inputs/outputs to avoid optimizer elision
  • add benchmark usage docs to README

Fixtures

  • add tests/fixtures/perf/real_small.map
  • add tests/fixtures/perf/real_medium.map
  • add tests/fixtures/perf/real_large.map

Validation

  • cargo fmt
  • cargo check --all-targets --all-features
  • cargo test
  • cargo bench --bench simple --no-run
  • cargo bench --bench simple -- --warm-up-time 0.1 --measurement-time 0.2 --sample-size 10

@codspeed-hq
Copy link

codspeed-hq bot commented Feb 8, 2026

CodSpeed Performance Report

Merging this PR will create unknown performance changes

Comparing chore/benchmark-simple-fixtures (a7c329c) with main (35d9711)1

Summary

🆕 13 new benchmarks
⏩ 5 skipped benchmarks2

Performance Changes

Benchmark BASE HEAD Efficiency
🆕 lookup_table[real_large] N/A 4.4 µs N/A
🆕 from_sourcemaps N/A 17.8 µs N/A
🆕 parse[real_large] N/A 66.5 µs N/A
🆕 add_sourcemap_loop N/A 20.4 µs N/A
🆕 build_single N/A 6.5 µs N/A
🆕 lookup_table[real_medium] N/A 1.4 µs N/A
🆕 lookup_table[real_small] N/A 1.3 µs N/A
🆕 from_json_string_inline N/A 16.5 µs N/A
🆕 parse[real_medium] N/A 17.4 µs N/A
🆕 parse[real_small] N/A 13.8 µs N/A
🆕 serialize[real_large] N/A 20.4 µs N/A
🆕 serialize[real_small] N/A 4.4 µs N/A
🆕 serialize[real_medium] N/A 5 µs N/A

Footnotes

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

  2. 5 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@Boshen Boshen merged commit ee47629 into main Feb 8, 2026
7 checks passed
@Boshen Boshen deleted the chore/benchmark-simple-fixtures branch February 8, 2026 03:50
@Boshen Boshen mentioned this pull request Feb 8, 2026
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