Skip to content

Optimize log filter matching and trigger allocation#6419

Merged
incrypto32 merged 2 commits intomasterfrom
krishna/log-filter-perf-clean
Mar 5, 2026
Merged

Optimize log filter matching and trigger allocation#6419
incrypto32 merged 2 commits intomasterfrom
krishna/log-filter-perf-clean

Conversation

@incrypto32
Copy link
Member

Replace all_edges() linear scan with contains_edge()/edge_weight() O(1) lookup in EthereumLogFilter::matches() and requires_transaction_receipt().

Replace flat_map(...).collect() with pre-allocated Vec in parse_log_triggers() to eliminate repeated reallocations.

CPU profiling indicated these two paths as hotspots during block processing.

Replace all_edges() linear scan with contains_edge() and edge_weight()
in matches() and requires_transaction_receipt().
Replace flat_map(...).collect() with explicit loops and a pre-sized Vec
to avoid repeated reallocations.
@incrypto32 incrypto32 merged commit c1fc51a into master Mar 5, 2026
6 checks passed
@incrypto32 incrypto32 deleted the krishna/log-filter-perf-clean branch March 5, 2026 05:14
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