Skip to content

Trim capacity of piggier allocations#806

Merged
frankmcsherry merged 1 commit into
masterfrom
capacity_trims
Jun 12, 2026
Merged

Trim capacity of piggier allocations#806
frankmcsherry merged 1 commit into
masterfrom
capacity_trims

Conversation

@frankmcsherry

Copy link
Copy Markdown
Member

Measurements

master @ 0823096c vs this branch, release, Apple Silicon. RSS sampled
via ps after construction completes (repeatable to ~0.1 MB); scaling
tests 3 runs each.

event_driven 1000 × 1000 master branch
peak RSS 4,320 MB 3,742 MB (−13.4%)
dataflow build time 1.53–1.56s 1.60–1.65s (+4–5%)
shape_scaling 100k master branch
operator_scaling 0.26s 0.25–0.26s
subgraph_scaling 0.29–0.30s 0.29–0.30s

Per the heap profile, the trimmed vectors were the second-largest
per-operator item: the frontier vector alone held 544 B (capacity 4 ×
136 B MutableAntichain) to store one 136 B element. The build-time
cost is the extra allocator round-trips from the shrink reallocs,
visible only on the chain-heavy benchmark; scaling tests sit at parity.

Pushing into initially empty vectors reserves capacity four; the
frontier, consumed, internal, and produced vectors hold one element per
port and live as long as the operator. The trade is one reallocation
per vector at build time for proportionate memory thereafter.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@frankmcsherry frankmcsherry merged commit 15fc7c9 into master Jun 12, 2026
9 checks passed
@frankmcsherry frankmcsherry deleted the capacity_trims branch June 12, 2026 20:19
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