> 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.
Among 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."
I'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.
Ye 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.
Yeah, 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.
Yeah 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.
I 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.
This 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.
bottleneck 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.
> 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#faster-cpyth...