4 ms·
I think it's more likely that people start using mypyc for performance-critical code. https://mypyc.readthedocs.io/en/latest/ https://mypyc.readthedocs.io/en/la
by keithasaurus 5y ago
I think it's more likely that people start using mypyc for performance-critical code. https://mypyc.readthedocs.io/en/latest/ https://mypyc.readthedocs.io/en/latest/
- formerly_proven 5y agoI assume the performance profile is similar to compiling regular Python code with Cython (which it can do). There is a decent but not world-changing speed-up; this makes sense, because pretty much the only thing you are removing from the equation is the instruction and stack overhead of the interpreter, you still have to perform all the equivalent work that CPython does, otherwise you would end up with different semantics. And this work is substantial. In contrast, a tracing JIT can dynamically elide most of this work without changing the semantics.
- xapata 5y agoAfter switching to Cython, you can add Cython syntax, like type definitions, to gain big speed improvements.
- rattray 5y agoWow, this looks exciting. Looks like Cython without any extra work/syntax, for those using mypy. I wish their readme gave some kind of estimate of how the speedups might compare to Cython and PyPy. But it's currently alpha, so there may be big differences by the time it's ready for production use. Similar approach to the Sorbet Compiler for Ruby (albeit targeting C instead of llvm... I wonder how that might impact optimizability).