-
-
Notifications
You must be signed in to change notification settings - Fork 276
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
Current state of performance #610
Comments
Thanks for doing this @nickdrozd I appreciate it. Also this is probably a good issue to keep track of the performance planning and status. We already have a project related to performance on pylint's side, but we didn't have yet a place to discuss potential avenues for improving astroid's and pylint's performance. |
Nice @nickdrozd - can you give the exact programs/commands used? I think I tried to replicate your graphs for some of the stuff I was working on, but couldn't figure out the visualizing. Also (as I'm sure you're both aware) it'd be great for this to be integrated into a build pipeline with the graphs published publicly somewhere etc. |
@kodonnell Take a look at nickdrozd/pylint@dad6955 I don't know if that's the best way to do it, but it works reasonably well. Here's an unsolicited piece of advice for doing performance work: DO NOT MEASURE TIMES WITH THE PROFILER RUNNING. The profiler makes everything run a lot slower, so the times measured will be way off. I've made this mistake! Heed my warning! (I realize that there is a |
So, I keep coming back to performance, so here are some ideas/summaries since that's what this issue is for.
However, the thing that makes this hard is quantifying performance - if someone wants to try to improve performance, they have to figure out how to test it themselves too. So, I'd like two things:
@nickdrozd @PCManticore - does the above approach seem reasonable? It needs a bit more fleshing out (e.g. which python version and architecture etc.) but if you approve of the general idea, then it seems worthwhile to me. EDIT: finally remembered airspeed velocity, and since it's the better tool, removed reference to pytest-benchmark. |
(Also, it might pay to cross-post the above into pylint as well, as that's generally where users care most about performance of astroid.) |
Another question - has anyone considered parallelism for performance, etc.? Since we're largely CPU bound (?), I don't think we'd get much benefit from standard threading (GIL etc.) so we'd have to do something else. This feels potentially 'easy' (with a queue of dependent inference tasks etc.) but that's probably very naive. |
Here is a yappi graph of Pylint running against
pycodestyle.py
:The numbers in the boxes are (1) the percentage of time spent in that function including its subcalls, (2) the percentage of time spent in that function excluding subcalls, and (3) the number of times the function is called.
The boxes are colored according to (2), with "hotter" colors taking more time and "cooler" colors taking less. Red is bad!
Note that the graph will be influenced to some degree by the targeted file, and could be different for different targets (larger repos, code with heavy use of certain features, etc).
This isn't a specific issue, but I didn't want to hijack another issue with this, and it seems like something that would be of interest to everyone.
The text was updated successfully, but these errors were encountered: