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).
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