4 ms·
The Psyco project (now dead) used to get very reasonable speedups (factors of several) in pure Python code, particularly for numeric algorithms. It was retired
by xioxox 6y ago
The Psyco project (now dead) used to get very reasonable speedups (factors of several) in pure Python code, particularly for numeric algorithms. It was retired because PyPy was being developed and was expected to solve all speed problems. I wonder why this approach worked while other python JITs did not.
- chubot 6y agoC is frequently 100x faster than Python for code like the example I showed. With autovectorization and other optimizations it can be 500x. So if a Python JIT does 10-50x better than CPython on a numeric workload, that sounds impressive, but it's still slow compared to C. And again they don't get 10-50x on string/hash/method call workloads. I think they're lucky to get 2x in some of those cases.
- coldtea 6y agoActually a lot of string stuff is just calling into C, and can be as fast a C (and often is).
- jashmatthews 6y agoJust calling into C doesn't give the performance you’re after a lot of the time. The compiler needs to be aware of the properties of strings. Usually they're implemented as either dedicated opcodes or intrinsics. You can see the simple ones in LuaJIT here https://github.com/LuaJIT/LuaJIT/blob/ff1e72acead01df7d8ed0fbb31efd32f57953618/src/lj_ffrecord.c#L745 https://github.com/LuaJIT/LuaJIT/blob/ff1e72acead01df7d8ed0f...