From 9a5290249047ce7182f8cfcbade8f5c94d162954 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Tue, 17 Dec 2024 12:32:21 +0900 Subject: [PATCH] Added YJIT entries from draft of release announcement --- NEWS.md | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index 0025cc5db9..21d2f73761 100644 --- a/NEWS.md +++ b/NEWS.md @@ -360,13 +360,13 @@ details of the default gems or bundled gems. * The default parser is now Prism. To use the conventional parser, use the command-line argument `--parser=parse.y`. [[Feature #20564]] + * Happy Eyeballs version 2 (RFC8305), an algorithm that ensures faster and more reliable connections by attempting IPv6 and IPv4 concurrently, is used in Socket.tcp and TCPSocket.new. To disable it globally, set the environment variable `RUBY_TCP_NO_FAST_FALLBACK=1` or call `Socket.tcp_fast_fallback=false`. Or to disable it on a per-method basis, use the keyword argument `fast_fallback: false`. [[Feature #20108]] [[Feature #20782]] -* Array#each is rewritten in Ruby for better performance [[Feature #20182]]. * Alternative garbage collector (GC) implementations can be loaded dynamically through the modular garbage collector feature. To enable this feature, @@ -385,7 +385,30 @@ details of the default gems or bundled gems. enabled using the environment variable `RUBY_GC_LIBRARY=mmtk`. This requires the Rust toolchain on the build machine. [[Feature #20860]] -## JIT +* New features of YJIT + * Add unified memory limit via `--yjit-mem-size` command-line option (default 128MiB) + which tracks total YJIT memory usage and is more intuitive than the + old `--yjit-exec-mem-size`. + * More statistics now always available via `RubyVM::YJIT.runtime_stats` + * Add compilation log to track what gets compiled via `--yjit-log` + * Tail of the log also available at run-time via `RubyVM::YJIT.log` + * Add support for shareable consts in multi-ractor mode + * Can now trace counted exits with `--yjit-trace-exits=COUNTER` + * Compressed context reduces memory needed to store YJIT metadata + +* New optimizations of YJIT + * Improved allocator with ability to allocate registers for local variables + * When YJIT is enabled, use more Core primitives written in Ruby: + * `Array#each`, `Array#select`, `Array#map` rewritten in Ruby for better performance [[Feature #20182]]. + * Ability to inline small/trivial methods such as: + * Empty methods + * Methods returning a constant + * Methods returning `self` + * Methods directly returning an argument + * Specialized codegen for many more runtime methods + * Optimize `String#getbyte`, `String#setbyte` and other string methods + * Optimize bitwise operations to speed up low-level bit/byte manipulation + * Various other incremental optimizations ## Miscellaneous changes