Module: Whoosh::Performance

Defined in:
lib/whoosh/performance.rb

Class Method Summary collapse

Class Method Details

.enable_yjit!Object



6
7
8
9
# File 'lib/whoosh/performance.rb', line 6

def self.enable_yjit!
  return unless defined?(RubyVM::YJIT)
  RubyVM::YJIT.enable unless yjit_enabled?
end

.optimize!Object



15
16
17
18
# File 'lib/whoosh/performance.rb', line 15

def self.optimize!
  enable_yjit!
  Serialization::Json.detect_engine!
end

.yjit_enabled?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/whoosh/performance.rb', line 11

def self.yjit_enabled?
  defined?(RubyVM::YJIT) && RubyVM::YJIT.enabled?
end