Live data from Hacker News

Python 3.13 Gets a JIT

tonybaloney.github.io

191–200 of 553 posts

Re: Python 3.13 Gets a JIT

#192
post #162

Earlier quoted context omitted.

Python is slow, reee. This is a major problem in scientific fields. Currently there are sort of "two tiers" of scientific programmers: ones who write the fast binary libraries and ones that use these from Python (until they encounter e.g. having to loop and they are SOL). This is known as the two language problem. It arises from Python being slow to run and compiled languages being bad to write. Julia tries to solve…

The major problem in scientific fields is not this, but the amount of incompetence and the race-to-the-bottom environment which enables it. Grant organizations don't demand rigor and efficiency, they demand shiny papers. And that's what we get. With god awful code and very questionable scientific value.

There are such issues, but I don't think they are a very direct cause of the two language problem.

And even these issues are part of the greater problem of late stage capitalism that in general produces god awful stuff with questionable value. E.g. vast majority of industry code is such.

Re: Python 3.13 Gets a JIT

#194

Earlier quoted context omitted.

Python is slow, reee. This is a major problem in scientific fields. Currently there are sort of "two tiers" of scientific programmers: ones who write the fast binary libraries and ones that use these from Python (until they encounter e.g. having to loop and they are SOL). This is known as the two language problem. It arises from Python being slow to run and compiled languages being bad to write. Julia tries to solve…

> Julia tries to solve this (but fails due to implementation details) Care to list some of those details ? (I have zero knowledge in Julia)

This is quite a good intro: https://viralinstruction.com/posts/badjulia/

Re: Python 3.13 Gets a JIT

#196
post #15

Earlier quoted context omitted.

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…

Having recently implemented parallel image rendering in corrscope ( https://github.com/corrscope/corrscope/pull/450 ), I can say that friends don't let friends write performance-critical code in Python. Depending on prebuilt C++ libraries hampers flexibility (eg. you can't customize the memory management or rasterization pipeline of matplotlib). Python's GIL inhibits parallelism within a process, and the workaround o…

> Python's GIL inhibits parallelism within a process, and the workaround of multiprocessing and shared memory is awkward, has inconsistencies between platforms, and loses performance

Well, imho the biggest problem with this approach to paralellism is that you're stepping out of the Python world with gc'ed objects etc. and into a world of ctypes and serialization. It's like you're not even programming Python anymore, but more something closer to C with the speed of an interpreted language.

Re: Python 3.13 Gets a JIT

#197
post #143
post #112

Earlier quoted context omitted.

And nobody writes short lived commands in those because of startup time.

Do a quick test with the latest JVM. Print Hello, world. That's it. Time it. Do the same with Python. The difference is minuscule. People don't build CLIs with them due to cultural reasons (fashion). Developers are creatures of fashion.

> Do a quick test with the latest JVM.

java: 031s python: 013s

it's 3x slower to start up… it means that any bash script with a loop calling a java command will run 3x slower.

3x slower isn't my definition of minuscule.

Re: Python 3.13 Gets a JIT

#198

Earlier quoted context omitted.

Just for giggles I tried this and I'm getting ~200ms when reading and hashing 50MB file in the browser (Chromium based) vs ~120ms using Python 3.11.6. https://jsfiddle.net/yebdnz6x/

Not so bad compared to what I tried a few years ago. Might finally be usable for us...

All major browsers have supported it for over eight years. Maybe the problem was between the seat and the keyboard?

https://caniuse.com/mdn-api_crypto_subtle

Re: Python 3.13 Gets a JIT

#199
post #154
post #112

Earlier quoted context omitted.

And nobody writes short lived commands in those because of startup time.

Rather those that don't know how to use the toolchains don't. JIT caches, AOT have been an option for years. And if you are really motivated, you can write stuff in C just like in Python.

You're naming things that need handling… which take time to be set up and so on.

Re: Python 3.13 Gets a JIT

#200
The last two-ish years have been insane for Python performance. Something clicked with the core team and they obviously made this a serious goal of theirs and the last few years have been incredible to see.
Post reply on HN