module ZJIT
This module allows for introspection of ZJIT, CRuby’s just-in-time compiler. Everything in the module is highly implementation specific and the API might be less stable compared to the standard library.
This module may not exist if ZJIT does not support the particular platform for which CRuby is built.
Public Class Methods
Source
# File zjit.rb, line 18 def stats stats = Primitive.rb_zjit_stats if stats.key?(:vm_insns_count) && stats.key?(:zjit_insns_count) stats[:total_insns_count] = stats[:vm_insns_count] + stats[:zjit_insns_count] stats[:ratio_in_zjit] = 100.0 * stats[:zjit_insns_count] / stats[:total_insns_count] end stats end
Source
# File zjit.rb, line 30 def stats_string buf = +'' stats = self.stats [ :total_insns_count, :vm_insns_count, :zjit_insns_count, :ratio_in_zjit, ].each do |key| value = stats[key] if key == :ratio_in_zjit value = '%0.1f%%' % value end buf << "#{'%-18s' % "#{key}:"} #{value}\n" end buf end