Live data from Hacker News

Python 3.13 Gets a JIT

tonybaloney.github.io

471–480 of 553 posts

Re: Python 3.13 Gets a JIT

#471

Earlier quoted context omitted.

What languages do you think it could realistically eat (that it hasn’t already)?

I'd love to see it eat JavaScript and Java for back-end code. But I doubt that's going to ever happen.

Despite the existence of WebAssembly, which some have suggested to be able to run a non-JS language, I just have a hard time seeing anything non-JS get popular for the web. The in browser debug/development environment just works too well.

Short of Google implementing something if Chrome hits 85-90% of all use in an attempt to dump JS it just doesn’t seem like something that would happen. I doubt any browser team would want to implement multiple languages. I doubt Google would want to switch.

Re: Python 3.13 Gets a JIT

#472
post #338

Why has it taken so much longer for CPython to get a JIT than, say, PyPy? I would imagine the latter has far less engineering effort and funding put into it.

I believe PyPy was written knowing it wouldn’t work with many C/C++ libraries used in the Python world.

That made it much easier to get bigger gains than if they wanted 100% backwards compatibility with CPython.

Re: Python 3.13 Gets a JIT

#473

Earlier quoted context omitted.

It's not the size of the improvement that's regrettable, it's the absolute performance after the improvement. No one is disappointed by V8's 6-8% improvement with Maglev. [1] Because V8 is (for a scripting language) insanely fast. And Python is not, unfortunately. [1] https://v8.dev/blog/holiday-season-2023

What are some good stats/benchmarks on the rough order of magnitude of python vs js perf these days?

https://benchmarksgame-team.pages.debian.net/benchmarksgame/...

In many cases, Node.js is an order of magnitude faster than CPython.

(Acknowledged: You could write your Python in C.)

(Acknowledged: PyPy exists.)

Re: Python 3.13 Gets a JIT

#474
post #17

Honestly I don't understand the pessimistic view here. I think every release since Microsoft started funding python has increased high single digit best case performance. Rather than focussing on the raw number compare to python 3.5 or so. It's still getting significantly faster. If they keep doing this steady pace they are slowly saving the planet!

I think the pessimism really comes from a dislike for Python While very very very popular, Python is i think is very disliked languages, it doesnt have or it is not built around the current programming language features that programmers like, its not functional or immutable by default, its not fast, the tooling is complex, it uses indentation for code blocks (this feature was cool in the 90s, but dreaded since at lea…

Python disliked? That doesn't resonate with my experience or repeated Stack Overflow surveys where Python is often near the top in admired and desired languages:

https://survey.stackoverflow.co/2023/#section-admired-and-de...

Re: Python 3.13 Gets a JIT

#477
post #372

Earlier quoted context omitted.

Copy and patch is a variant of QEMU's original "dyngen" backend by Fabrice Bellard[1][2], with more help from the compiler to avoid the maintainability issues that ultimately led QEMU to use a custom code generator. [1] https://www.usenix.org/legacy/event/usenix05/tech/freenix/fu... [2] https://review.gerrithub.io/plugins/gitiles/spdk/qemu/+/5a24...

Ultimately, most good ideas were first implemented by Fabrice Bellard.

Heard of him; he's done a lot of stuff. So is he the Bourbaki of software?

https://en.m.wikipedia.org/wiki/Nicolas_Bourbaki

Re: Python 3.13 Gets a JIT

#478

Earlier quoted context omitted.

I like python but I would never choose it for anything more than trivial on the backend. I want to know what types are being passed around from one middleware function to the next. Yes python has annotations but that’s not enough.

Type annotations are pretty good. I'd like to see a strict mode though, something you import that makes missing annotations anywhere into a fatal error

Have you looked into Mypy with the strict flag?

https://mypy.readthedocs.io/en/stable/command_line.html#cmdo...

Re: Python 3.13 Gets a JIT

#479

Wasn't CPython supposed to remain very simple in its codebase, with the heavy optimization left for other implementations to tackle? I seem to remember hearing as much a few years back.

PyPy was released 17 years ago Jython was released 22 years ago IronPython was released 17 years ago To date, no Python implementation has managed to hit all three: 1. Stay compatible with any recent, modern CPython version 2. Maintain performance for general-purpose usage (it's fast enough without a warmup, and doesn't need to be heavily parallelized to see a performance benefit) 3. Stayed alive Which, frankly, is k…

Isn't PyPy up to 3.10 by now? At least that's what Homebrew reports to me.

PyPy seems pretty alive, all things considered, and for my code bases I've seen pretty dramatic speedups on the order of 2-5x. That's basically a no brainer unless I'm doing something with incompatible C extensions, which I think is the real Achilles heel of all of these alternative implementations.

Re: Python 3.13 Gets a JIT

#480

Earlier quoted context omitted.

Given how many Microsoft employees today steer the Python decision making process, I'm sure in not so distant future, we might see a new CLR-based Python implementation. Maybe Microsoft don't know yet how to sell this thing, or maybe they are just boiling the frog. Time will tell. But I'm pretty sure your question will be repeated as soon as people will get used to the idea of Python on JIT.

“Python code runs 15% faster and and 20% cheaper on azure than aws, thanks to our optimized azurePython runtime. Use it for azure functions and ml training” Just a guess at the pitch.

How much of Python in the world is ran on Azure? It's my language of preference and the main professional one, along with JS/TS and Go. But if they pulled something like this I'm pretty sure I'd reluctantly pack things up and move to Go.
Post reply on HN