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

Profile and optimize mypy #11547

Closed
JukkaL opened this issue Nov 13, 2021 · 4 comments
Closed

Profile and optimize mypy #11547

JukkaL opened this issue Nov 13, 2021 · 4 comments
Assignees
Labels
feature meta Issues tracking a broad area of work performance

Comments

@JukkaL
Copy link
Collaborator

JukkaL commented Nov 13, 2021

We haven't done any profiling in a while, as far as I know, and I've found some regressions and low-hanging fruit that we can easily fix.

  • Profile compiled mypy and look for hot functions
  • Manually optimize some functions (focus on compiled performance, interpreted performance is less important)
  • Consider fixing bottlenecks or inefficiencies in mypyc
  • Maybe run some type checking benchmark across historical commits and look for additional regressions
@JukkaL
Copy link
Collaborator Author

JukkaL commented Nov 13, 2021

Some of the optimizations may have a pretty minor impact (say 0.5% or less), but they can still be worthwhile. For example, 20 small optimizations that each average a 0.5% improvement can together improve performance by 10%, which is already quite significant.

@KotlinIsland
Copy link
Contributor

Maybe if you rewrite mypy in Rust it would be a lot faster, lots of js tool are currently transitioning to Go/Rust due to the performance benefits (swc, esbuild, Rome, Next.js, deno, dprint, Parcel)

https://leerob.io/blog/rust

@hauntsaninja
Copy link
Collaborator

hauntsaninja commented Nov 14, 2021

By far the biggest perf win we've had recently was #10922. There's probably more we can do on the theme of "not doing work that then gets thrown away".

@97littleleaf11 97littleleaf11 added the meta Issues tracking a broad area of work label Nov 17, 2021
@hauntsaninja
Copy link
Collaborator

Closing, since there's been some recent perf work in this vein.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature meta Issues tracking a broad area of work performance
Projects
None yet
Development

No branches or pull requests

5 participants