Sven R. Kunze wrote:
Are there some resources on why register machines are considered faster than stack machines?
If a register VM is faster, it's probably because each register instruction does the work of about 2-3 stack instructions, meaning less trips around the eval loop, so less unpredictable branches and less pipeline flushes. This assumes that bytecode dispatching is a substantial fraction of the time taken to execute each instruction. For something like cpython, where the operations carried out by the bytecodes involve a substantial amount of work, this may not be true. It also assumes the VM is executing the bytecodes directly. If there is a JIT involved, it all gets translated into something else anyway, and then it's more a matter of whether you find it easier to design the JIT to deal with stack or register code. -- Greg _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com