Skip to content

Optimize log filter matching and trigger allocation#6419

Open
incrypto32 wants to merge 2 commits intomasterfrom
krishna/log-filter-perf-clean
Open

Optimize log filter matching and trigger allocation#6419
incrypto32 wants to merge 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.
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