Repository navigation
perf(scoring): keep emptied link buckets in their slot instead of a pool - #282
Merged
Merged
Conversation
The bucket pool from the previous change held every retired bucket in an extra vector, so the scoring path kept more memory than 0.31.3 at its peak: group_ruin +544 bytes and route_rows +1,568 bytes in the zero-regression gate. An emptied bucket now stays in its HandleMap slot, and the next handle of that slot takes it over through HandleMap::get_or_reuse. No side vector remains, and steady-state notification still allocates nothing. Against 0.31.3, group_ruin runs 8.8% fewer instructions with 8.0% fewer simulated D1 misses and a 992-byte lower peak; route_rows runs 9.4% fewer instructions with 6.5% fewer D1 misses. route_rows still peaks 32 bytes higher: one bucket stays in its slot across a move, where 0.31.3 frees it and allocates it again.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change and Purpose
Emptied output-link buckets now stay in their slot and the next handle of that slot takes them over. The side pool from #281 is gone, and with it the extra memory it held at peak.
Verification
Measured against v0.31.3 with the gate's features:
The 32 bytes are one bucket that stays in its slot through a move, where v0.31.3 frees it and allocates it again. The amount is fixed and does not grow with problem size. The owner accepted it.
make lintandmake test(1664 tests) pass.