4 ms·
Not surprising. Register-based machines in general have higher performance than stack-based machines, because the register set can be addressed randomly like RA
by userbinator 10y ago
Not surprising. Register-based machines in general have higher performance than stack-based machines, because the register set can be addressed randomly like RAM whereas in a 'strict' stack machine this isn't possible.
https://en.wikipedia.org/wiki/Stack_machine#Performance_disadvantages_of_stack_machines https://en.wikipedia.org/wiki/Stack_machine#Performance_disa...
Of course the advantages such as easy code generation and high code density make stack machines a good intermediate compilation target, which then gets compiled to a register machine for actual execution.
- bogomipz 10y ago>"Of course the advantages such as easy code generation and high code density make stack machines a good intermediate compilation target, which then gets compiled to a register machine for actual execution" Are you referring to a specific language here or are you saying all register machine always compile to stack machines first?
- userbinator 10y agoIn general they do. The JVM and .NET CLR being the most prominent examples.