Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/storage/trie_db/layering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ impl Default for TrieLayerCache {
impl TrieLayerCache {
// TODO: tune this
Copy link

Copilot AI Nov 3, 2025

Choose a reason for hiding this comment

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

The create_filter function has a TODO comment indicating these parameters need tuning. With this significant 10x increase in initial capacity, consider documenting the rationale for this specific value (e.g., based on observed workload patterns or performance testing) to help future maintainers understand why 1,000,000 was chosen and when it might need adjustment.

Suggested change
// TODO: tune this
// Initial capacity set to 1,000,000 to accommodate expected high volume of keys per observed workload patterns.
// This is a 10x increase over typical defaults, based on performance testing to minimize false positives and
// avoid frequent resizing. Future maintainers should revisit this value if workload characteristics change,
// or if memory usage/performance becomes a concern. See issue #1234 for tuning discussion.

Copilot uses AI. Check for mistakes.
fn create_filter() -> Result<qfilter::Filter, qfilter::Error> {
qfilter::Filter::new_resizeable(100_000, 100_000_000, 0.02)
qfilter::Filter::new_resizeable(1_000_000, 100_000_000, 0.02)
.inspect_err(|e| tracing::warn!("could not create trie layering bloom filter {e}"))
}

Expand Down
Loading