mypyc for the stdlib #423
Replies: 2 comments 1 reply
-
Pickle has a C version already so presumably there isn't a huge benefit there. Experience from Cython suggests maybe a 20% speed-up if you just compile Python code directly. I image mypyc would be a similar order of magnitude. I think the idea of compiling bits of the standard library with Cython has been discussed and rejected before (mainly because it'd add a third party dependency). I don't know if mypyc is a little more "affiliated" and so would be more acceptable. Especially if the code didn't need to be adapted so could run without mypyc |
Beta Was this translation helpful? Give feedback.
-
Compatibility is going to be a big issue if using mypyc. Fwiw, using mypyc on black is about a 2x speed up (without too much optimisation). mypyc on mypy is a 3.5-4x speed up. |
Beta Was this translation helpful? Give feedback.
-
with the classical approach to speedups in the stdlib being porting to c,
i was wondering how well it might work to use tools like mypyc to turn the python into c
possible candidates for that are at least logging, pathlib, warnings, pickle, single_dispatch
naive enthusiasm projects potentially big wins, but compatibility may be tricky
Beta Was this translation helpful? Give feedback.
All reactions