-
Notifications
You must be signed in to change notification settings - Fork 68
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
Smol optimizations #166
Smol optimizations #166
Conversation
i.e. push and pop at the end of the list instead of at the beginning
BitVecSort256 = BitVecSorts[256] | ||
BitVecSort264 = BitVecSorts[264] | ||
BitVecSort512 = BitVecSorts[512] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q: could you help me understand the behavior of this global mutable object when multiple SEVM objects are created?
for example, say we have two sevm objects:
from halmos.sevm import SEVM
sevm1 = SEVM(options)
sevm2 = SEVM(options)
will they have the same cache object, or a different one?
if the former, would it be safe when we run sevm1 and sevm2 in parallel in a thread or process pool?
in any case, can we avoid the use of global mutable objects?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're right I didn't think of that, both instances would access the same object because it's at the module level. I can make it read only to avoid this issue
this means that not every BitVecSort will be cached, only the ones deemed most common during initialization
I think the CI failures are now due to farcaster being in a bad state (farcasterxyz/contracts#275 (comment)), unrelated to the changes in this PR |
yes, i know that. cicada test was canceled because of that. i set fail-fast false, so that we can make sure that all but farcaster test succeed. let's merge after we confirm that. |
2 things:
Saves about 10% on some path-intensive benchmark (172M -> 156M function calls), coming mostly from caching