Yarv: another Ruby Virtual Machine

Source: Internet
Author: User

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.

    Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.