[前][次][番号順一覧][スレッド一覧]

ruby-changes:37904

From: ko1 <ko1@a...>
Date: Tue, 17 Mar 2015 18:58:05 +0900 (JST)
Subject: [ruby-changes:37904] ko1:r49985 (trunk): * benchmark/bm_vm1_gc_wb_ary(_promoted).rb: separate fastpath and

ko1	2015-03-17 18:57:47 +0900 (Tue, 17 Mar 2015)

  New Revision: 49985

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=49985

  Log:
    * 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.

  Added files:
    trunk/benchmark/bm_vm1_gc_wb_ary_promoted.rb
    trunk/benchmark/bm_vm1_gc_wb_obj_promoted.rb
  Modified files:
    trunk/ChangeLog
    trunk/benchmark/bm_vm1_gc_wb_ary.rb
    trunk/benchmark/bm_vm1_gc_wb_obj.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 49984)
+++ ChangeLog	(revision 49985)
@@ -1,3 +1,21 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue Mar 17 18:51:43 2015  Koichi Sasada  <ko1@a...>
+
+	* 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.
+
 Tue Mar 17 17:23:11 2015  Nobuyoshi Nakada  <nobu@r...>
 
 	* dir.c (glob_helper): distinguish not-yet-stated and DT_UNKNOWN
Index: benchmark/bm_vm1_gc_wb_obj_promoted.rb
===================================================================
--- benchmark/bm_vm1_gc_wb_obj_promoted.rb	(revision 0)
+++ benchmark/bm_vm1_gc_wb_obj_promoted.rb	(revision 49985)
@@ -0,0 +1,17 @@ https://github.com/ruby/ruby/blob/trunk/benchmark/bm_vm1_gc_wb_obj_promoted.rb#L1
+class C
+  attr_accessor :foo
+end
+long_lived = C.new
+
+if RUBY_VERSION > "2.2.0"
+  3.times{ GC.start(immediate_mark: false, lazy_sweep: false) }
+elsif
+  GC.start
+end
+
+i = 0
+short_lived = ''
+while i<30_000_000 # while loop 1
+  long_lived.foo = short_lived # write barrier
+  i+=1
+end
Index: benchmark/bm_vm1_gc_wb_ary_promoted.rb
===================================================================
--- benchmark/bm_vm1_gc_wb_ary_promoted.rb	(revision 0)
+++ benchmark/bm_vm1_gc_wb_ary_promoted.rb	(revision 49985)
@@ -0,0 +1,14 @@ https://github.com/ruby/ruby/blob/trunk/benchmark/bm_vm1_gc_wb_ary_promoted.rb#L1
+long_lived = []
+
+if RUBY_VERSION > "2.2.0"
+  3.times{ GC.start(immediate_mark: false, lazy_sweep: false) }
+elsif
+  GC.start
+end
+
+i = 0
+short_lived = ''
+while i<30_000_000 # while loop 1
+  long_lived[0] = short_lived # write barrier
+  i+=1
+end
Index: benchmark/bm_vm1_gc_wb_ary.rb
===================================================================
--- benchmark/bm_vm1_gc_wb_ary.rb	(revision 49984)
+++ benchmark/bm_vm1_gc_wb_ary.rb	(revision 49985)
@@ -1,10 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/benchmark/bm_vm1_gc_wb_ary.rb#L1
-long_lived = []
-GC.start
-GC.start
+short_lived_ary = []
 
 i = 0
 short_lived = ''
 while i<30_000_000 # while loop 1
-  long_lived[0] = short_lived # write barrier
+  short_lived_ary[0] = short_lived # write barrier
   i+=1
 end
Index: benchmark/bm_vm1_gc_wb_obj.rb
===================================================================
--- benchmark/bm_vm1_gc_wb_obj.rb	(revision 49984)
+++ benchmark/bm_vm1_gc_wb_obj.rb	(revision 49985)
@@ -1,13 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/benchmark/bm_vm1_gc_wb_obj.rb#L1
 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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]