The full name of yarv is yet another Ruby Vm, which is another Ruby Virtual Machine implemented by Sasada Koichi.
At present, Ruby's virtual machine is completed through AST (Abstract syntax tree), which is slow and can only be used for pure script interpretation. yarv is designed to solve this problem, it is based on the stack VM. the main purpose is to speed up Ruby scripts.
The following figure shows how quickly yarv is used to improve Ruby's execution speed compared to common Ruby virtual machines. yarv uses multiple methods to optimize Ruby's execution speed. The list is as follows:
Base: only base VM
DTC: Direct threaded code
Si: specialized instruction
Ou: operands unification
IU: Instructions unification
IMC: In-line method Cache
SC: Stack caching
From the chart, we can see that the yarv speed improvement is amazing, and the fastest increase is nearly 25 times.
The current yarv version is only 0.3.3, which is far from practical use. We hope it can be used in ruby2.0.