-
-
Notifications
You must be signed in to change notification settings - Fork 625
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
Improve performance of linerange #629
Conversation
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.
Can you please attach the file long_set.py, so I can compare as well for the review? Thanks!
Sure! |
Ok, I measured it again:
result:
updated version from Krock21rus:cache_linerange(this pull request) command:
result:
57s -> 1s on a single long_set with 7276 'a' elements |
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.
Very noticeable improvement. Nicely done. However, I do think most of this linerange() func becomes redundant with Python 3.8 included end_lineno on nodes.
I found that the bandit is running very slow on the file long_set.py
I added some caching for linerange function
Feel free to comment and propose a better solution
See time measurements down below