Skip to content

Conversation

@yannham
Copy link
Member

@yannham yannham commented Dec 5, 2025

After looking at flamegraphs for other reasons, some reserves took a surprisingly visible portion of the graph (on the order of the %). Those reserve don't make sense (they unconditionally reserve more space for cases where it's not clear what will happen, which is a waste if we don't need it, and in the event where we actually extend the vector, the default behavior should only resize once in the vast majority of cases).

The most surprising effect is on memory though. This seems to have a large impact, with overall 22% less peak memory consumption on the OPL benchmark, and 27% less leaked memory in total.

@yannham yannham requested a review from jneem December 5, 2025 16:44
@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2025

🐰 Bencher Report

Branchperf/remove-useless-reserve
Testbedubuntu-latest
Click to view all benchmark results
BenchmarkLatencymicroseconds (µs)
diagnostics-benches/inputs/goto-perf.ncl📈 view plot
🚷 view threshold
10,241.00 µs
diagnostics-benches/inputs/large-record-tree.ncl📈 view plot
🚷 view threshold
191,300.00 µs
diagnostics-benches/inputs/redis-replication-controller.ncl📈 view plot
🚷 view threshold
307.94 µs
diagnostics-benches/inputs/small-record-tree.ncl📈 view plot
🚷 view threshold
429.74 µs
fibonacci 10📈 view plot
🚷 view threshold
220.95 µs
foldl arrays 50📈 view plot
🚷 view threshold
393.44 µs
foldl arrays 500📈 view plot
🚷 view threshold
2,825.30 µs
foldr strings 50📈 view plot
🚷 view threshold
2,882.30 µs
foldr strings 500📈 view plot
🚷 view threshold
27,284.00 µs
generate normal 250📈 view plot
🚷 view threshold
22,944.00 µs
generate normal 50📈 view plot
🚷 view threshold
1,176.20 µs
generate normal unchecked 1000📈 view plot
🚷 view threshold
1,885.40 µs
generate normal unchecked 200📈 view plot
🚷 view threshold
381.04 µs
init-diagnostics-benches/inputs/goto-perf.ncl📈 view plot
🚷 view threshold
53,559.00 µs
init-diagnostics-benches/inputs/large-record-tree.ncl📈 view plot
🚷 view threshold
207,040.00 µs
init-diagnostics-benches/inputs/redis-replication-controller.ncl📈 view plot
🚷 view threshold
48,850.00 µs
init-diagnostics-benches/inputs/small-record-tree.ncl📈 view plot
🚷 view threshold
48,652.00 µs
pidigits 100📈 view plot
🚷 view threshold
1,882.70 µs
pipe normal 20📈 view plot
🚷 view threshold
607.47 µs
pipe normal 200📈 view plot
🚷 view threshold
4,491.70 µs
product 30📈 view plot
🚷 view threshold
264.39 µs
requests-benches/inputs/goto-perf.ncl-000📈 view plot
🚷 view threshold
3,035.50 µs
requests-benches/inputs/large-record-tree.ncl-000📈 view plot
🚷 view threshold
574,310.00 µs
requests-benches/inputs/large-record-tree.ncl-001📈 view plot
🚷 view threshold
86.02 µs
scalar 10📈 view plot
🚷 view threshold
492.90 µs
sum 30📈 view plot
🚷 view threshold
264.89 µs
🐰 View full continuous benchmarking report in Bencher

Copy link
Member

@jneem jneem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice find!

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.

3 participants