News for hackers. Stuff that matters.
Re:How Python bytecode is executed by jashmatthews on Monday November 09, 2020 @09:03PM (#25042146)
The fast bytecode VMs do pre-fetch the operands to maximize Instruction Level Parallelism: https://www.reddit.com/r/programming/comments/badl2/luajit_2...

They also use "inline caching" where the result of method lookup is cached in the bytecode itself. Most of the time there's no need to try to pre-execute it.

The ultimate version of this idea of executing everything you can before running the dynamic bit is probably Partial Evaluation which is how GraalPython works.

Re:How Python bytecode is executed by fulafel on Tuesday November 10, 2020 @01:16AM (#25043244)
Yep, Psyco was also based on partial evaluation and Futamura projections IIRC, lots of potential there.

I guess the very ultimate version is a transformation that takes your program AND its inputs, and completely specializes everything to those inputs :)

An advantage of the runahead idea is that with luck the change could be small and simple, and might realistically be accepted as an incremental change into the CPython codebase. Iff the runahead could be made truly guaranteed idempotent and obviously correct.