Live data from Hacker News

Python 3.13 Gets a JIT

tonybaloney.github.io

11–20 of 553 posts

Re: Python 3.13 Gets a JIT

#14
post #4

> The initial benchmarks show something of a 2-9% performance improvement. You might be disappointed by this number, especially since this blog post has been talking about assembly and machine code and nothing is faster than that right? Indeed, reading the blog post build much higher expectations

Just running machine code itself does not make a program magically faster. It‘s all about the amount of work the machine code is doing.

For example, if the JIT compiler realizes the program is adding two integers it could potentially replace the code with two MOVs and a single ADD. However, what about the error handling in the case of an overflow? Python switches to its internal BigInt representation in this case and cannot rely on architecture specific instructions alone once the result gets too large to fit into a register.

Modern programming languages are all about trading performance for convenience and that is what makes them slow — not because they are running an interpreter and not compiling to machine code.

Re: Python 3.13 Gets a JIT

#15
post #6

I always wondered how Python can be one of the world's most popular languages without anyone (company) stepping up and make the runtime as fast as modern JavaScript runtimes.

Python is already fast where it matters: often, it is just used to integrate existing C/C++ libraries like numpy or pytorch. It is more an integration language than one where you write your heavy algorithms in.

For JS, during the time that it received its JITs, there was no cross platform native code equivalent like wasm yet. JS had to compete with plugins written in C/C++ however. There was also competition between browser vendors, which gave the period the name "browser wars". Nowadays at least, the speed improvements for the end user thanks to JIT aren't also that great, Apple provides a mode to turn off JIT entirely for security.

Re: Python 3.13 Gets a JIT

#16
Unfortunate to see a couple of comments here drive-by pulling out the “x% faster” stat whilst minimising the context. This is a big deal and it’s effectively a given that this’ll pave the way for further enhancements.

Re: Python 3.13 Gets a JIT

#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!

Re: Python 3.13 Gets a JIT

#18
post #6

I always wondered how Python can be one of the world's most popular languages without anyone (company) stepping up and make the runtime as fast as modern JavaScript runtimes.

Billions of dollars of product decisions use JS benchmark speed as one of the standard benchmarks to base buying decision on (for a good reason).

For machine learning speed compiling to the right CUDA / OpenCL kernel is much more crucial, so there's where the money goes.

Re: Python 3.13 Gets a JIT

#19
post #5

The bit everyone wants: > The initial benchmarks show something of a 2-9% performance improvement. Which is underwhelming (as mentioned in the article), especially if we look at PyPy[0]. But it's a step forward nonetheless. [0] https://speed.pypy.org/

> At the moment, the JIT is only used if the function contains the JUMP_BACKWARD opcode which is used in the while statement but that will change in the future.

It's a bit less underwhelming if you consider that only function objects with loops are being JITed. nb: for loops in Python also use the JUMP_BACKWARD op.

Re: Python 3.13 Gets a JIT

#20
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!

Sorry, but reality bites https://en.wikipedia.org/wiki/Amdahl%27s_law
Post reply on HN