Skip to content

Conversation

@RaduBerinde
Copy link
Contributor

Simplify segment count calculation

Allow initial sizing of BinaryFuseBuilder

Add MakeBinaryFuseBuilder which pre-initializes a binary fuse
builder to a certain initial size, guaranteeing no allocations up to
that size. This avoids reallocations as the buffers grow.

We also improve the reuseBuffer method to use an append pattern
(relying on the internal formulas for slice growth) and isolate the
unsafe hack to the single place where it is needed now (fingerprints
slice).

Add `MakeBinaryFuseBuilder` which pre-initializes a binary fuse
builder to a certain initial size, guaranteeing no allocations up to
that size. This avoids reallocations as the buffers grow.

We also improve the `reuseBuffer` method to use an `append` pattern
(relying on the internal formulas for slice growth) and isolate the
unsafe hack to the single place where it is needed now (fingerprints
slice).
@lemire
Copy link
Member

lemire commented Jan 20, 2026

@RaduBerinde This one is an easy merge.

(I have not forgotten about the other PR, but it is not as easy to review, I won't delay forever.)

@lemire lemire merged commit 4e5a4d9 into FastFilter:master Jan 20, 2026
5 checks passed
@RaduBerinde
Copy link
Contributor Author

Thanks!

@RaduBerinde RaduBerinde deleted the pre-size branch January 20, 2026 02:46
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.

2 participants