Skip to content
This repository was archived by the owner on Feb 18, 2025. It is now read-only.

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

Closed
wants to merge 1 commit into from

Conversation

minh-bq
Copy link
Collaborator

@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
Collaborator 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

@minh-bq minh-bq requested review from DNK90 and andicrypt January 12, 2024 03:28
@minh-bq minh-bq force-pushed the feat/improve-get-logs branch from 50f8c38 to 438af62 Compare September 25, 2024 06:34
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.
@minh-bq minh-bq force-pushed the feat/improve-get-logs branch from 438af62 to 15ef4fa Compare September 25, 2024 06:54
@minh-bq minh-bq closed this by deleting the head repository Feb 18, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant