mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	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.
		
			
				
	
	
		
			20 lines
		
	
	
	
		
			281 B
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
	
		
			281 B
		
	
	
	
		
			YAML
		
	
	
	
	
	
prelude: |
 | 
						|
  class A
 | 
						|
    def set_ivars
 | 
						|
      @a = nil
 | 
						|
      @b = nil
 | 
						|
      @c = nil
 | 
						|
      @d = nil
 | 
						|
      @e = nil
 | 
						|
    end
 | 
						|
  end
 | 
						|
  class B < A; end
 | 
						|
  class C < A; end
 | 
						|
 | 
						|
  b = B.new
 | 
						|
  c = C.new
 | 
						|
benchmark:
 | 
						|
  vm_ivar_init_subclass: |
 | 
						|
    b.set_ivars
 | 
						|
    c.set_ivars
 | 
						|
loop_count: 3000000
 |