Skip to content

Merge BuiltinFilterBitsBuilder into FilterBitsBuilder for accurate filter size estimation#14111

Closed
nmk70 wants to merge 2 commits intofacebook:mainfrom
nmk70:nk-filter-merge
Closed

Merge BuiltinFilterBitsBuilder into FilterBitsBuilder for accurate filter size estimation#14111
nmk70 wants to merge 2 commits intofacebook:mainfrom
nmk70:nk-filter-merge

Conversation

@nmk70
Copy link
Contributor

@nmk70 nmk70 commented Nov 6, 2025

Summary:
Merge the BuiltinFilterBitsBuilder into FilterBitsBuilder. This enables using
CalculateSpace() for accurate filter size estimation instead of hardcoded
bits-per-key which could result in under/over estimations for different filter types.
The previous hardcoded estimate of 15 bits per key was in the filter block builders UpdateFilterSizeEstimate().

Test Plan:

  • Existing filter tests pass (bloom_test, full_filter_block_test, filter_bench, db_bloom_filter_test)

@meta-cla meta-cla bot added the CLA Signed label Nov 6, 2025
@meta-codesync
Copy link

meta-codesync bot commented Nov 7, 2025

@nmk70 has imported this pull request. If you are a Meta employee, you can view this in D86473287.

@nmk70 nmk70 marked this pull request as ready for review November 7, 2025 00:18
@nmk70 nmk70 requested review from cbi42 and pdillinger November 7, 2025 00:18
Copy link
Contributor

@pdillinger pdillinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks!

@meta-codesync
Copy link

meta-codesync bot commented Nov 10, 2025

@nmk70 merged this pull request in b897c37.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants