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

Deduplicate index keys #12

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

Conversation

YaroShkvorets
Copy link
Contributor

Implements #10

Reduces number of index keys 3-4x for Ethereum mainnet.

  • saves substreams cache space
  • improves performance (probably?)

@maoueh
Copy link
Contributor

maoueh commented Aug 30, 2024

The keys are de-deduped on the backend as they are saved within a map[...]... component so it doesn't really in terms of space saving.

Now the question boils down to does adding a HashSet to dedupe keys is worth it vs the extra processing happening when we send multiple time the same key to the backing engine. My gut feeling tells me it will be more efficient to leave them as-is and avoid the HashSet.

I'm not totally sure how to prove this. I've just added a benchmarking setup on ethereum-common, I can at least probably gather the difference time this adds to see the impact of just adding HashSet.

@YaroShkvorets
Copy link
Contributor Author

Ah yes, makes sense. Probably not worth it compacting keys in the module then. Feel free to close this PR if your benchmark doesn't show any improvement.

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