Skip to content

perf(CuckooFilter): avoid rescanning dirty cuckoo filter pages during cache eviction - #3816

Open
nagisa-kunhah wants to merge 2 commits into
apache:unstablefrom
nagisa-kunhah:perf/cf-clean-page-index
Open

nagisa-kunhah wants to merge 2 commits into
apache:unstablefrom
nagisa-kunhah:perf/cf-clean-page-index

Conversation

@nagisa-kunhah

@nagisa-kunhah nagisa-kunhah commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Description

Track clean cuckoo filter pages in a separate list so DiscardCleanPages() only visits clean pages instead of repeatedly scanning dirty pages accumulated during bulk insertion. Keep the list consistent across writes, rollback, and cache resets.

Validation:

  • All 89 Cuckoo C++ tests passed, including coverage for rollback, dirty-page preservation, cache growth, and cache reuse.
  • Formatting checks passed.
  • Benchmarked single-key and multi-key workloads with 16K–256K items, three runs per case. Release build, one worker/client, INSERT batches of 128, DELETE pipeline of 128, WAL enabled and sync disabled. All 60 runs passed response and final-count checks.

Median elapsed-time growth for a 16× increase in item count:

Workload INSERT DELETE
Fixed 1,024 items/key; increasing key count 17.7× 18.8×
Fixed 128 keys; increasing items/key 16.0× 23.7×
Single key with reserved capacity 37.8× 19.5×
Single key with expansion=1 27.1× 90.3×

Median phase peak resident set size at the endpoints:

Workload INSERT, 16K INSERT, 256K DELETE, 16K DELETE, 256K
Fixed 1,024 items/key; increasing key count 33.1 MiB 37.3 MiB 67.9 MiB 215.2 MiB
Fixed 128 keys; increasing items/key 33.1 MiB 41.4 MiB 39.8 MiB 174.6 MiB
Single key with reserved capacity 37.2 MiB 147.1 MiB 72.0 MiB 138.7 MiB
Single key with expansion=1 33.9 MiB 65.5 MiB 68.7 MiB 132.8 MiB

These are current-version scaling measurements, not before/after speedups. Deletion still scales poorly as subfilters accumulate.

AI assistance: OpenAI Codex, GPT6 Astra assisted with implementation, tests, and benchmarking.

@jihuayu

jihuayu commented Nov 27, 2026

Copy link
Copy Markdown
Member

Hi @nagisa-kunhah Is everything OK now? Do you need any help from me?

@nagisa-kunhah

Copy link
Copy Markdown
Contributor Author

Hi @jihuayu , I think this PR is ready for review now. Please take a look when you have time and feel free to leave comments. Thanks!

@nagisa-kunhah
nagisa-kunhah marked this pull request as ready for review November 28, 2026 14:43
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.

3 participants