• vrighter@discuss.tchncs.de
    link
    fedilink
    arrow-up
    8
    arrow-down
    2
    ·
    8 months ago

    python is a language explicitly designed to resist any form of proper optimization. It just can’t be made fast

    • Corbin@programming.dev
      link
      fedilink
      English
      arrow-up
      3
      ·
      8 months ago

      This is a common misconception! It is true that, of the Smalltalk descendants, Python was not designed for speed like Self or Java; but it was not designed to be slow or difficult to compile. The main technique required to implement a Python JIT is virtualizable objects, which allows the JIT to temporarily desynchronize the contents of registers from the contents of the heap; it’s not obvious and wasn’t in the first few iterations of PyPy. Additionally, it turns out that tracing the meta-level (see docs or the paper) is a key trick: instead of JIT’ing the Python program, the JIT operates on the interpreter, on the Python VM itself!