Comment by mattbillenstein

Comment by mattbillenstein 5 months ago

2 replies

The JIT will improve - you can also use PyPy to get speedups on programs that don't use a ton of C extensions.

Also, free-threading is coming so we'll have threads soon.

I don't know if Python can every really be fast as by design, objects are scattered all over memoryand even things like iterating a list, you're chasing pointers to PyObject all over the place - it's just not cache friendly.

olau 5 months ago

PyPy has a list implementation that specializes under the hood. So if you stuff it with integers, it will contain the integers directly instead of pointers to them. That's at least how I understood it.

  • mattbillenstein 5 months ago

    Yeah, Python has the array class too - well and numpy/torch/etc. Useful for numeric stuff, but you can't say have like a list of objects all contiguous very easily I don't believe.