Skip to content

Defer AnchoredSetVariable bucket allocation - #2

Draft
upgle wants to merge 1 commit into
v3/masterfrom
agent/lazy-anchored-set-reserve
Draft

Defer AnchoredSetVariable bucket allocation#2
upgle wants to merge 1 commit into
v3/masterfrom
agent/lazy-anchored-set-reserve

Conversation

@upgle

@upgle upgle commented Aug 1, 2026

Copy link
Copy Markdown
Owner

What

  • Remove the eager reserve(10) call from AnchoredSetVariable construction.
  • Preserve the existing initial capacity by reserving on the first insertion through either set overload.

Why

Each Transaction constructs 20 AnchoredSetVariable collections. Reserving buckets in every constructor allocates capacity for collections that may remain unused for the lifetime of the transaction. Deferring the reserve avoids those empty-collection allocations while keeping the existing capacity behavior for populated collections.

The public API and class layout are unchanged.

Validation

  • ./build.sh
  • ./configure --enable-assertions=yes
  • make -j4
  • make check -j4 — 5,043 total, 4,995 passed, 48 skipped, 0 failed

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