Ruby 3.3 Release: Performance optimization and new features for developers

Brother

Professional
Messages
2,590
Reaction score
533
Points
113
The new version of Ruby rewrites the JIT compiler, which increases the speed of code execution.

The development team announced the release of a major update to Ruby 3.3.0 , a new major version of the popular programming language focused on rapid development of web applications and services. This release brought a number of innovations aimed at improving the performance of the CRuby interpreter and expanding the functionality of the language.

A few important changes:
  1. Prism Parser: Ruby 3.3.0 includes the Prism parser implemented in the form of the libprism C library and the Ruby gem package. This parser is used in the CRuby interpreter and provides a public API for parsing Ruby code, which makes it useful for working projects. Prism is characterized by good portability and flexible error handling in the code.
  2. Lrama Project: For generating parsers in Ruby 3.3.0, the Lrama project is used . This project provides an implementation of the LALR algorithm in Ruby and supports the grammar definitions used in CRuby. It also provides advanced features such as error handling and parameterized rules.
  3. YJIT JIT Compiler Improvement: The YJIT JIT compiler has been significantly optimized in this version of Ruby. YJIT is developed by the Shopify team to increase the performance of Ruby programs that use the Rails framework and execute many methods. The new YJIT uses base Block versioning (LBBV-Lazy Basic Block Versioning) instead of processing methods entirely and is written in Rust. This significantly improved the performance of Ruby applications.
  4. New RJIT JIT Compiler: Ruby 3.3.0 introduces a new JIT compiler called RJIT. It is written entirely in Ruby and replaces the previously used MJIT. RJIT only supports x86-64 architecture and Unix-like platforms, and it does not require compilation in C.
  5. Thread Scheduler "M:N": This version of Ruby includes the thread scheduler " M:N", which allows you to effectively use a limited number of operating system threads to process threads in Ruby code. This can reduce the overhead of creating and managing threads. By default, 8 operating system threads are used.
  6. Improvements to the IRB Shell: The IRB Interactive Computing Shell (REPL) has received several improvements, including a debug mode, support for multi-page viewing of command output, and experimental support for automatic input completion.
  7. Other changes: Ruby 3.3.0 deprecated the use of the "it" method without arguments in a block without parameters. Also added a warning when specifying certain gem packages in "require", if they are not added to Gemfile or gemspec.

The project code is distributed under the BSD ("2-clause BSDL") and Ruby licenses, which refer to the latest version of the GPL license and are fully compatible with GPLv3.
 
Top