-
Notifications
You must be signed in to change notification settings - Fork 979
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
Optimizations for similar_variables.py #1945
Conversation
There were some further optimizations (down to ~14 seconds for the MAIA codebase) that I didn't include in this PR since I wasn't 100% sure that they wouldn't break anything if anything external depended on the It's possible to feed already lowercase variable names into And AFAIK this line can be deleted:
since v2 won't be re-compared to v1 with the new inner loop setup. Something like this:
So if further optimization is desired, these are possibilities. |
that's awesome, thanks @0xGusMcCrae |
I think we can reformat |
Fixes #1630
Optimizations to the algorithm for detecting similar variable names in similar_variables.py.
Runtime for slither/dev on current C4 competiton MAIA codebase:
Runtime for optimized version on same codebase:
Runtime is reduced by >50% here, and the issues detected are identical.
Changes (in
detect_sim
):