Repository navigation
perf(construction): reuse candidate buffers across placements - #225
Merged
Merged
Conversation
Descriptor-placement scalar construction allocated about ten short-lived buffers per placement: a fresh candidate store, the candidate value list (plus an index vector and a second collected vector under ascending-key value order), and the slot's candidate values collected into a Vec before they were visited. Construction time then depended on where glibc placed those buffers. A placement cursor now takes finished placements back (EntityPlacerCursor::recycle, called by the construction phase after each step) and reuses their candidate store and value buffer. Ascending-key value order sorts the buffer in place, keeping offered order between equal keys. Static scalar slots visit candidate values without collecting them, and buffer fillers copy them in one bulk call. The __bench placement cursor gains recycle, so the gate's construction_full case drives placements the way the phase does. Against v0.24.0 on the isolated zero-regression gate: construction first fit -48% instructions, construction full -12%, ruin -43%, with every case producing identical results. Closes #222
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.
Closes #222.
Scalar construction allocated about ten short-lived buffers per placement. A placement cursor now takes finished placements back (EntityPlacerCursor::recycle, called by the construction phase after each step) and reuses their candidate store and value buffer; static scalar slots visit candidate values without collecting them, and buffer fillers copy them in one bulk call. The __bench placement cursor gains recycle so the gate's construction_full case drives placements as the phase does.