Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

class method

RubyVM::YJIT.max_compile_time_ns

max_compile_time_ns

The maximum amount of time YJIT is allowed to spend compiling. When total_compile_time_ns goes over max_compile_time_ns, YJIT pause compilation until max_compile_time_ns is raised. If set to 0, there is no limit. This is a best-effort functionality, there are situations in which YJIT may still compile even when paused. This feature is intended to be used to control how fast the JIT warms up, to spread the compilation overhead over a longer period of time.