Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eth/filters: reduce database read when handling eth_getLogs #395

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

minh-bq
Copy link
Contributor

@minh-bq minh-bq commented Jan 11, 2024

While profiling, we see that when bloom filter hits, 1/3 CPU time in check log
match routine is used to get the corresponding block number from block hash.
This is redundant as this information is available already and can be passed via
function argument.

@minh-bq
Copy link
Contributor Author

minh-bq commented Jan 11, 2024

Before this PR, around 1/3 CPU time when GetLogs is used to rawdb.ReadHeaderNumber, the other is used to rawdb.ReadLogs
get_logs

After this PR, most of CPU time when GetLogs is used to rawdb.ReadLogs
get_logs_v2

While profiling, we see that when bloom filter hits, 1/3 CPU time in check log
match routine is used to get the corresponding block number from block hash.
This is redundant as this information is available already and can be passed via
function argument. This commit adds block number parameter to GetLogs interface
to pass the available block number information.
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