File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 1616
1717system ( 'mkdir' ,  '-p' ,  File . dirname ( OUT_CSV_PATH ) ) 
1818
19+ def  yjit_enabled? 
20+   # We could add other values here if we discover any 
21+   # but for now all we want to know is if YJIT was enabled at runtime. 
22+   RubyVM ::YJIT . enabled?  if  defined? ( RubyVM ::YJIT ) 
23+ end 
24+ 
25+ ORIGINAL_YJIT_ENABLED  =  yjit_enabled? 
26+ 
1927puts  RUBY_DESCRIPTION 
2028
2129def  realtime 
@@ -52,4 +60,8 @@ def run_benchmark(_num_itrs_hint, &block)
5260    non_warmups_ms  =  ( ( non_warmups . sum  / non_warmups . size )  * 1000.0 ) . to_i 
5361    puts  "Average of last #{ non_warmups . size }  , non-warmup iters: #{ non_warmups_ms }  ms" 
5462  end 
63+ 
64+   if  yjit_enabled?  != ORIGINAL_YJIT_ENABLED 
65+     raise  "Benchmark altered YJIT configuration! (changed from #{ ORIGINAL_YJIT_ENABLED . inspect }   to #{ yjit_enabled? . inspect }  )" 
66+   end 
5567end 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments