4 ms·
Crickey: > Python 3.11 is up to 10-60% faster than Python 3.10. On average, we measured a 1.25x speedup on the standard benchmark suite. See Faster CPython for
by throw0101a 4y ago
Crickey:
> Python 3.11 is up to 10-60% faster than Python 3.10. On average, we measured a 1.25x speedup on the standard benchmark suite. See Faster CPython for details.
* https://docs.python.org/3.11/whatsnew/3.11.html https://docs.python.org/3.11/whatsnew/3.11.html
* https://docs.python.org/3.11/whatsnew/3.11.html#faster-cpython https://docs.python.org/3.11/whatsnew/3.11.html#faster-cpyth...
- jamesfinlayson 4y agoAmong other things: "In Python 3.11, the core modules essential for Python startup are “frozen”. This means that their code objects (and bytecode) are statically allocated by the interpreter." Very nice.
- throwaway81523 4y agoI'd prefer that they had done something like unexec to allow loading some arbitrary set of modules into a bootstrapping image, then dumping a runnable executable that would launch with all those modules already present. The old Emacs approaches are now mostly busted, but there are alternatives.
- eslaught 4y agoYe olde Lisp dump image. A neat approach, but results in an absolutely horrific cross compilation experience. As someone who worked briefly on a Common Lisp implementation, including trying to get it to cross-compile, I'm very glad this technique hasn't caught on in the broader community.
- throwaway81523 4y agoYeah, it is pretty unworkable now, and Emacs uses an object serialization approach that still works pretty well, but there are other methods too. There is some OpenVZ-derived way to make process snapshots in Linux whose name I've forgotten, but I've been wanting to look into it for this.
- Vogtinator 4y agoCRIU (https://criu.org/Main_Page https://criu.org/Main_Page)?
- throwaway81523 4y agoYeah that might have been it, or something closely related. I do remember looking at that page and a bunch of similar ones. This was after there was a huge thread in the python.org bug tracker about speeding up Python start times, and they ended up doing it in a somewhat painful and module-specific manner. I wished they had done something like this instead. Linux really would benefit from some kind of kernel support for snapshotting executables, since there are all kinds of programs like libreoffice that are currently slow to start.
- aunty_helen 4y agoI checked out 3.11b3, simply by swapping 3.10->3.11 interpreter I measured a clock time improvement of 19% on a basic data processing and file output task. The gains are real.
- kzrdude 4y agoGreat, can't wait for some jupyterlab speedups
- toyg 4y agoThis is what I was mentioning in the PyScript thread: CPython gets faster with every release, and WASM gets more efficient with every release; sooner or later the sum of these efforts will deliver a solution that is fast enough even in the browser, without us having to faff with the underlying JS at all.
- kevinmgranger 4y agoFor computation, sure. But isn't the wasm/js to DOM boundary always going to be a bottleneck? Maybe I'm being too negative and a faster browser API will be developed.
- toyg 4y agobottleneck compared to what, native desktop drawing? Obviously, but that's not really an option anymore. Compared to JS performance over the same tasks - that's where WASM improvements should deliver. It doesn't have to be as fast as JS, just fast enough to become an acceptable alternative for the average case.