Skip to content

feat: optimize utility_methods.py #3667

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

Merged
merged 2 commits into from
Apr 21, 2025
Merged

Conversation

BobTheBuidler
Copy link
Contributor

@BobTheBuidler BobTheBuidler commented Apr 17, 2025

This was originally part of my other PR but that is becoming quite cluttered and hard to review so I separated this one out.

What was wrong?

Previously, the code would create a new dict from d one time for each item in the checked iterable. Now the code creates just one new dict from d at the beginning and uses that same dict to check membership for each item.

Related to Issue #N/A
Closes #N/A

How was it fixed?

Call dict one time prior to entering the genexp, instead of calling it repeatedly inside.

Todo:

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

@BobTheBuidler BobTheBuidler marked this pull request as ready for review April 17, 2025 19:36
This was originally part of my other PR but that is becoming quite cluttered and hard to review so I separated this one out. 

Previously, the code would create a new dict from `d` one time for each item in the iterable.

Now, the code creates just one new dict from `d` at the beginning and uses that same dict to check membership for each item.
@BobTheBuidler
Copy link
Contributor Author

Now that you've merged #3665 and #3666 I rebased my branch on master and reran the tests, looks like everything passes now

The failure in py310-integration-goethereum-ws was due to a timeout and seems to be unrelated to the PR

Copy link
Contributor

@pacrob pacrob left a comment

Choose a reason for hiding this comment

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

Thanks!

@pacrob pacrob merged commit 7bec6f7 into ethereum:main Apr 21, 2025
85 checks passed
@BobTheBuidler BobTheBuidler deleted the patch-4 branch April 22, 2025 13:32
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