news.volyx.in

Python 3.13 Gets a JIT (tonybaloney.github.io)

1081 points by todsacerdoti · 954 days ago · 521 comments on HN

Article summary

Python 3.13 is getting a Just-In-Time (JIT) compiler, which is a significant change to the CPython interpreter. The JIT compiler works by copying and patching machine code instructions for each bytecode, allowing for faster execution. The initial benchmarks show a 2-9% performance improvement. This change is seen as foundational work to enable later improvements and optimizations.

Main themes

  • Python performance
  • JIT compiler
  • Dynamic typing
  • Gradual typing
  • Optimizations
  • Language design tradeoffs

What commenters say

  • The initial 2-9% performance improvement is a significant accomplishment, especially considering CPython is already written in C.
  • Many small improvements can add up to make a big difference in performance, as seen in other projects like SQLite.
  • The JIT compiler is a step towards making Python faster, but it will never be as fast as statically-typed languages like Rust or C++.
  • The use of type hints in Python may help improve performance, but they are not required to be correct and do not affect runtime evaluation.
  • Dynamism in programming languages can limit performance, but it is not an excuse to not try to improve performance.
  • Gradual typing and optional type declarations can help enable optimizing compilers and improve performance.
  • The JIT compiler is just the beginning, and future optimizations and improvements will be built on top of this foundation.