File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 1616
1717system ( 'mkdir' , '-p' , File . dirname ( OUT_CSV_PATH ) )
1818
19+ # We could include other values in this result if more become relevant
20+ # but for now all we want to know is if YJIT was enabled at runtime.
21+ def yjit_enabled?
22+ RubyVM ::YJIT . enabled? if defined? ( RubyVM ::YJIT )
23+ end
24+ ORIGINAL_YJIT_ENABLED = yjit_enabled?
25+
1926puts RUBY_DESCRIPTION
2027
2128def realtime
@@ -52,4 +59,8 @@ def run_benchmark(_num_itrs_hint, &block)
5259 non_warmups_ms = ( ( non_warmups . sum / non_warmups . size ) * 1000.0 ) . to_i
5360 puts "Average of last #{ non_warmups . size } , non-warmup iters: #{ non_warmups_ms } ms"
5461 end
62+
63+ if yjit_enabled? != ORIGINAL_YJIT_ENABLED
64+ raise "Benchmark altered YJIT configuration! (changed from #{ ORIGINAL_YJIT_ENABLED . inspect } to #{ yjit_enabled? . inspect } )"
65+ end
5566end
You can’t perform that action at this time.
0 commit comments