Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Ruby 4.0.0, released on December 25, 2025, adds two experimental features: ZJIT, a new just-in-time compiler, and Ruby::Box, which isolates Ruby definitions within a single process. ZJIT is faster than the interpreter but not yet as fast as YJIT; Ruby advises against deploying it in production for now. Ruby::Box can help keep definitions such as monkey patches separate, but it is not a replacement for process or container security boundaries.

What is new in Ruby 4.0.0?

The release’s headline changes are aimed at two different concerns: execution speed and controlling how code affects other code in the same Ruby process.

  • ZJIT is a new method-based JIT compiler intended as the next generation of YJIT. It is experimental in Ruby 4.0.0.
  • Ruby::Box provides experimental isolation for definitions loaded into a box. Enable the feature with RUBY_BOX=1.
  • Ractors also receive updates: Ruby 4.0 adds Ractor::Port and Ractor.shareable_proc, alongside other Ractor improvements.

The Ruby project’s Ruby 4.0.0 release announcement reports 3,889 files changed, 230,769 insertions, and 297,003 deletions since Ruby 3.4.0. Those totals indicate the scope of changes, not a measure of application compatibility or performance.

What Ruby::Box isolates—and what it does not

Ruby describes Ruby::Box as an experimental way to separate definitions. With RUBY_BOX=1 enabled, the Ruby::Box class can create boxes whose loaded definitions are isolated from those in other boxes. The release announcement says, “Definitions loaded in a box are isolated in the box.”

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

That scope includes monkey patches, global and class-variable changes, class and module definitions, and loaded Ruby or native libraries. This is useful when code that shares a process would otherwise affect another test or application version—for example, when testing code with a patched dependency alongside the unpatched version.

Where Ruby::Box may be useful

  • Isolated tests: Keep definitions used by one test context from leaking into another.
  • Parallel blue-green web-app boxes: Run different application versions in separate boxes within one Ruby process, a use case identified by Ruby.
  • Dependency-update comparisons: Compare responses from code using different dependency definitions, another use case identified by Ruby.

Ruby::Box versus processes and containers

Question Ruby::Box Separate process or container
Isolation scope Isolates Ruby definitions inside one Ruby process, according to the Ruby 4.0.0 release announcement. Provides an operating-system-level process boundary; container boundaries depend on their configuration.
Monkey patches and loaded libraries Ruby says definitions, including changes and loaded libraries, can be isolated between boxes. Separate processes have separate runtimes and loaded definitions.
Startup and memory cost Not stated in the Ruby 4.0.0 release announcement. Not stated there; actual costs depend on the application and deployment.
Security boundary Definition isolation is not evidence of an operating-system security boundary. Do not treat a box as containment for untrusted code. Processes and containers can provide stronger separation, but their security depends on operating-system and deployment configuration.
Best-supported use cases Ruby documents isolated tests, parallel blue-green web-app boxes, and dependency-update response comparisons. Use when the needed separation is at the process or deployment level; Ruby’s release announcement does not compare these approaches.

Ruby::Box is therefore best understood as a way to manage definition collisions, not as a lightweight substitute for all the resource, failure, or security separation provided by processes. The release announcement establishes isolation of definitions; it does not establish that boxes contain arbitrary native-code behavior or isolate operating-system resources.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

What ZJIT does, and whether it is faster than YJIT

ZJIT is a method-based just-in-time compiler that compiles Ruby code while a program runs. Ruby calls it the next generation of YJIT. The key qualification is the release’s own performance statement: “ZJIT is faster than the interpreter, but not yet as fast as YJIT.” Ruby encourages experimentation but advises holding off on production deployment.

Runtime option Performance and maturity in Ruby 4.0.0 Memory and setup
Interpreter Baseline execution without JIT compilation. ZJIT uses more memory than the interpreter because generated machine code and compiler state remain in memory.
YJIT Ruby 4.0.0’s release announcement says ZJIT is not yet as fast as YJIT. A benchmark percentage is not stated in that announcement. Not stated in the cited Ruby 4.0.0 release material.
ZJIT Faster than the interpreter, but not yet as fast as YJIT; experimental in Ruby 4.0.0 and not recommended for production deployment by Ruby. Requires a Ruby build with ZJIT support. The Ruby 4.0 manual lists a default executable-memory limit of 128 MiB and a default call threshold of 30.

The documented default call threshold means a method must reach the configured call count before it is considered for JIT compilation. It is not a promise of a particular warm-up time or end-to-end speedup. Ruby has not published a comparison percentage in the cited release material, so a numeric claim about how much faster or slower ZJIT is than YJIT would be unsupported.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

How to enable ZJIT in Ruby 4.0

There are two runtime entry points, but both require a Ruby executable built with ZJIT support. If your Ruby installation lacks that support, passing the runtime flag or calling the API will not add it; install or build a compatible Ruby first.

  1. Check the build. Ruby must have been compiled with ZJIT support. Building Ruby with ZJIT requires Rust 1.85.0 or newer, according to the Ruby project’s Ruby 4.0 JIT documentation.
  2. Enable it for a command. Start Ruby with --zjit, for example ruby --zjit app.rb.
  3. Or enable it at runtime. In a supported Ruby process, call RubyVM::ZJIT.enable.
  4. Measure before adjusting. Compare representative application behavior with and without ZJIT, including warm-up and memory use. Avoid inferring production readiness from a small script or a single result.

Platforms and memory

The Ruby 4.0 manual lists ZJIT support for macOS, Linux, and BSD on x86-64 and arm64/aarch64. It uses more memory than the interpreter because compiled machine code and compiler state remain in memory. The documented default --zjit-mem-size is 128 MiB; the default call threshold is 30. These are defaults, not performance guarantees or universal memory requirements.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

Build modes and tuning

The manual describes release, stats, dev_nodebug, and dev build modes. The development mode performs extensive IR validation, which slows compilation and warm-up; it is intended for development rather than representative production performance measurements. Ruby also documents options for executable-memory size, the call threshold, profile count, statistics, and tracing. Consult the Ruby 4.0 JIT manual for the exact option names and behavior for your build.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Is Ruby 4.0.0 safe for production?

The release’s experimental cautions apply to the new features, not automatically to every Ruby 4.0 application. Ruby explicitly advises against production deployment of ZJIT in 4.0.0 because it is still experimental and has not yet matched YJIT. That is the clearest answer for teams considering the new compiler: test it outside production, but do not treat it as a production-ready YJIT replacement.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

Ruby::Box is also experimental. Its documented definition-isolation use cases may be valuable for controlled testing or application-version comparisons, but the release does not establish it as a security boundary or guarantee suitability for every multi-tenant workload. Assess it against the isolation your application actually requires.

For the rest of a Ruby 4.0 upgrade, validate the application and dependencies in a representative environment before rollout. The fact that a feature is new in the release does not establish whether a particular application, native extension, or deployment workflow is compatible.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.