From f6e9452b23e4aeb84c2c3cd12eaa10d802115fa6 Mon Sep 17 00:00:00 2001 From: ko1 Date: Tue, 17 Mar 2015 09:57:47 +0000 Subject: * benchmark/bm_vm1_gc_wb_ary(_promoted).rb: separate fastpath and slowpath for WB. Before this change bm_vm1_gc_wb_ary.rb tried to check the performance for WB slowpath (making a reference from oldobj to newobj). However, from Ruby 2.2, 3 GCs are needed to promote new objects because only 3 age objects are promted objects. To compare fastpath and slowpath, introduce new "promoted" version benchmark. bm_vm1_gc_wb_ary.rb is for fastpath and bm_vm1_gc_wb_ary_promoted.rb is for slowpath. * benchmark/bm_vm1_gc_wb_obj(_promtoed).rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- benchmark/bm_vm1_gc_wb_obj.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'benchmark/bm_vm1_gc_wb_obj.rb') diff --git a/benchmark/bm_vm1_gc_wb_obj.rb b/benchmark/bm_vm1_gc_wb_obj.rb index 017eff4f94..9e0aadbbaf 100644 --- a/benchmark/bm_vm1_gc_wb_obj.rb +++ b/benchmark/bm_vm1_gc_wb_obj.rb @@ -1,13 +1,11 @@ class C attr_accessor :foo end -long_lived = C.new -GC.start -GC.start +short_lived_obj = C.new i = 0 short_lived = '' while i<30_000_000 # while loop 1 - long_lived.foo = short_lived # write barrier + short_lived_obj.foo = short_lived # write barrier i+=1 end -- cgit v1.2.3