Re:Astral – "We're building a new static type checker for Py...
by E_Bfx on Wednesday January 29, 2025 @05:26PM
(#42872070)
In a medium size codebase (~ 100 python modules of 200 lines), mypy take 5 minutes to type check. This can be a problem for a CI.
[ Parent
| on HN ]
Re:Astral – "We're building a new static type checker for Py...
by wk_end on Wednesday January 29, 2025 @07:55PM
(#42873496)
Just to throw my anecdote in: I used to work at the mypy shop - our client code base was on the order of millions of lines of very thorny Python code. This was several years ago, but to the best of my recollection, even at that scale, mypy was nowhere near that slow.
Like I said, this was many years ago - mypy might've gotten slower, but computers have also gotten faster, so who knows. My hunch is still that you have an issue with misconfiguration, or perhaps you're hitting a bug.
Re:Astral – "We're building a new static type checker for Py...
by wavemode on Wednesday January 29, 2025 @11:33PM
(#42874882)
My current company is a Python shop, 1M+ LOC. My CI run earlier today completed mypy typechecking in 9 minutes 5 seconds. Take from that what you will.
Re:Astral – "We're building a new static type checker for Py...
by Redoubts on Thursday January 30, 2025 @02:28PM
(#42881241)
Ditto, same order of magnitude experience; at least for --no-incremental runs.
Part of the problem for me is how easily caches get invalidated. A type error somewhere will invalidate the cache of the file and anything in its dependency tree, which blows a huge hole runtime.
Checking 1 file in a big repo can take 10 seconds, or more than a minute as a result.
Re:Astral – "We're building a new static type checker for Py...
by E_Bfx on Saturday February 01, 2025 @09:33AM
(#42898582)
I guess that there is something with the cache that we don't do right. Thanks for your return.
Re:Astral – "We're building a new static type checker for Py...
by sgarland on Wednesday January 29, 2025 @07:08PM
(#42873117)
I think you have something misconfigured, or are timing incorrectly. I'm working on a project right now with ~10K LOC. I haven't timed it, but it's easily <= 2 seconds. Even if I nuke MyPy's cache, it's at most 5 seconds. This is on a M3 MBP FWIW.
Re:Astral – "We're building a new static type checker for Py...
by imron on Wednesday January 29, 2025 @07:34PM
(#42873323)
And with dmypy (included with myoy) it’s even faster
Re:Astral – "We're building a new static type checker for Py...
by Redoubts on Thursday January 30, 2025 @02:32PM
(#42881285)
I've found dmypy very underbaked. It's very easy to get it to regularly crash or pin a CPU indefinitely in my codebase.
Re:Astral – "We're building a new static type checker for Py...
by imron on Thursday January 30, 2025 @05:02PM
(#42882613)
Yeah it’s far from perfect, but speed is usually not its biggest fault.
I’ll still be switching to the astral offering as soon as it’s production ready.
Re:Astral – "We're building a new static type checker for Py...
by zelphirkalt on Wednesday January 29, 2025 @05:51PM
(#42872333)
Never happened for me. Similarly sized code base, done in seconds, if not 1s. Guess we all have our anecdotes.