aboutsummaryrefslogtreecommitdiffstats
path: root/benchmark
diff options
context:
space:
mode:
Diffstat (limited to 'benchmark')
-rw-r--r--benchmark/bm_vm1_gc_wb_ary.rb6
-rw-r--r--benchmark/bm_vm1_gc_wb_ary_promoted.rb14
-rw-r--r--benchmark/bm_vm1_gc_wb_obj.rb6
-rw-r--r--benchmark/bm_vm1_gc_wb_obj_promoted.rb17
4 files changed, 35 insertions, 8 deletions
diff --git a/benchmark/bm_vm1_gc_wb_ary.rb b/benchmark/bm_vm1_gc_wb_ary.rb
index ecfab51dbf..e80538a2da 100644
--- a/benchmark/bm_vm1_gc_wb_ary.rb
+++ b/benchmark/bm_vm1_gc_wb_ary.rb
@@ -1,10 +1,8 @@
-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
diff --git a/benchmark/bm_vm1_gc_wb_ary_promoted.rb b/benchmark/bm_vm1_gc_wb_ary_promoted.rb
new file mode 100644
index 0000000000..612ec9f888
--- /dev/null
+++ b/benchmark/bm_vm1_gc_wb_ary_promoted.rb
@@ -0,0 +1,14 @@
+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
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
diff --git a/benchmark/bm_vm1_gc_wb_obj_promoted.rb b/benchmark/bm_vm1_gc_wb_obj_promoted.rb
new file mode 100644
index 0000000000..7967e83726
--- /dev/null
+++ b/benchmark/bm_vm1_gc_wb_obj_promoted.rb
@@ -0,0 +1,17 @@
+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