Skip to content

perf: Avoid a heap allocation per basic block in MoveData's location maps - #73

Closed
xmakro wants to merge 1 commit into
perf/base-0713from
perf/location-map-single-alloc
Closed

perf: Avoid a heap allocation per basic block in MoveData's location maps#73
xmakro wants to merge 1 commit into
perf/base-0713from
perf/location-map-single-alloc

Conversation

@xmakro

@xmakro xmakro commented Jul 31, 2026

Copy link
Copy Markdown
Owner

MoveData holds two LocationMaps, and each was an IndexVec<BasicBlock, Vec<T>> that heap-allocated one Vec per basic block. Building the move data for a body allocated a small vector for every block, twice over. Store the entries in one flat buffer indexed by a per-block start offset, so each map is two allocations regardless of block count.

@xmakro
xmakro force-pushed the perf/location-map-single-alloc branch 3 times, most recently from 606f7ab to 942e5f9 Compare July 31, 2026 04:52
@xmakro xmakro changed the title Avoid a heap allocation per basic block in MoveData's location maps [-0.41%] perf: Avoid a heap allocation per basic block in MoveData's location maps Jul 31, 2026
@xmakro
xmakro force-pushed the perf/location-map-single-alloc branch from 942e5f9 to 10f3e23 Compare July 31, 2026 04:59
@xmakro
xmakro force-pushed the perf/location-map-single-alloc branch from 10f3e23 to 6f198ee Compare July 31, 2026 05:02
@xmakro xmakro closed this Jul 31, 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