Recently, the Ruby code repository has added a PR about merging YJIT.

According to reports, YJIT is a just-in-time compiler built using the Lazy Basic Block Versioning (LBBV) compiler architecture.

In the actual benchmark test, YJIT is 23% faster than the current CRuby interpreter on average.

The Ruby development team plans to include YJIT in the preview version of Ruby 3.1 so that more users can help them test it for performance improvements.

Currently YJIT is disabled by default, you need to turn on the --yjit option or set YJIT\_RUBY\_ENABLE=1 to enable it. It should be noted that YJIT only supports macOS and Linux systems and x86-64 CPU architecture for the time being.

other problems

  • On unsupported platforms, Ruby uses a traditional interpreter
  • The generated code has no garbage collection function. If it exceeds the set --yjit-exec-mem-size error will be reported. The development team said that this issue will be resolved in the next few months.
  • YJIT will use more memory at runtime because it needs to allocate machine code, which can be adjusted by setting the value of --yjit-exec-mem-size
  • YJIT cannot be enabled at the same time as MJIT, only one of the two can be active at runtime.

snakesss
1.1k 声望243 粉丝

SegmentFault 思否编辑,欢迎投稿优质技术资讯!


引用和评论

0 条评论