mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	Fixes ivar benchmarks to not depend on object allocation
Prior to this change, we were measuring object allocation as well as setting instance variables within ivar benchmarks. With this change, we now only measure setting instance variables within ivar benchmarks.
This commit is contained in:
		
							parent
							
								
									7424ea184f
								
							
						
					
					
						commit
						c53439294e
					
				
				
				Notes:
				
					git
				
				2022-07-15 23:30:02 +09:00 
				
			
			
			
		
		
					 3 changed files with 14 additions and 7 deletions
				
			
		| 
						 | 
				
			
			@ -1,6 +1,6 @@
 | 
			
		|||
prelude: |
 | 
			
		||||
  class C
 | 
			
		||||
    def initialize
 | 
			
		||||
    def set_ivars
 | 
			
		||||
      @a = nil
 | 
			
		||||
      @b = nil
 | 
			
		||||
      @c = nil
 | 
			
		||||
| 
						 | 
				
			
			@ -8,7 +8,9 @@ prelude: |
 | 
			
		|||
      @e = nil
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  c = C.new
 | 
			
		||||
benchmark:
 | 
			
		||||
  vm_ivar_extended_obj_init: |
 | 
			
		||||
    C.new
 | 
			
		||||
    c.set_ivars
 | 
			
		||||
loop_count: 30000000
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue