Skip to content

perf(scoring): keep emptied link buckets in their slot instead of a pool - #282

Merged
blackopsrepl merged 1 commit into
mainfrom
perf/in-place-link-buckets
Nov 28, 2026
Merged

blackopsrepl merged 1 commit into
mainfrom
perf/in-place-link-buckets

Conversation

@blackopsrepl

Copy link
Copy Markdown
Collaborator

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:

  • group_ruin: 8.8% fewer instructions, 8.0% fewer simulated D1 misses, peak memory 992 bytes lower.
  • route_rows: 9.4% fewer instructions, 6.5% fewer simulated D1 misses, peak memory 32 bytes higher.

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 lint and make test (1664 tests) pass.

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.
@blackopsrepl
blackopsrepl merged commit 68eb2c3 into main Nov 28, 2026
7 checks passed
@blackopsrepl
blackopsrepl deleted the perf/in-place-link-buckets branch November 28, 2026 09:12
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