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

perf: make e2hs writer 44x faster for generating E2HS files from Era1 files #1754

Merged
merged 1 commit into from
Apr 12, 2025

Conversation

KolbyML
Copy link
Member

@KolbyML KolbyML commented Apr 11, 2025

What was wrong?

We where deserializing the Era1 file every time for every block retrieved from the Era1 file. So we were deserializing the Era1 file 8192 times.

Before time: 8m27.011s

After my fix: 0m11.451s

^ these results came from generating E2HS file 1655

How was it fixed?

I removed get_tuple_by_index() as the function is just not good and encourages bad patterns. Instead of using get_tuple_by_index I decoded the Era1 file once, then parsed the block_tuple out when needed

@KolbyML KolbyML self-assigned this Apr 11, 2025
Copy link
Collaborator

@morph-dev morph-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

@KolbyML KolbyML merged commit 6c51837 into ethereum:master Apr 12, 2025
14 checks passed
@KolbyML KolbyML deleted the fix-e2hs-writer branch April 12, 2025 08:00
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