Skip to content
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

Add intenal flag for per-line type checking peformance #14173

Merged
merged 2 commits into from Nov 23, 2022

Conversation

ilevkivskyi
Copy link
Member

This should help with the investigation of tricky performance regressions like #13821.

I tried to implement in such a way that it will give minimal impact when not used (since I am touching a hot method).

mypy/checkexpr.py Outdated Show resolved Hide resolved
@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

Copy link
Collaborator

@JukkaL JukkaL left a comment

Choose a reason for hiding this comment

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

This looks very useful! I tried it out and the results look good. A few ideas about how to make this even more useful (no need to do these now):

  • Generating JSON could make it a little easier to analyze the data. Analyzing the data requires some scripting, and JSON would save a few lines of code.
  • Providing a tool that would analyze the data and print out some derived stats (e.g. the most expensive lines) could be helpful. This could be a script in misc/, for example.

@ilevkivskyi
Copy link
Member Author

Yes, I think a tool would be helpful, I will add it later.

@ilevkivskyi ilevkivskyi merged commit 04d44c1 into python:master Nov 23, 2022
@ilevkivskyi ilevkivskyi deleted the add-line-timing-stats branch November 23, 2022 14:31
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.

None yet

2 participants