summaryrefslogtreecommitdiff
path: root/benchmark
diff options
context:
space:
mode:
authorkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-01 10:39:12 +0000
committerkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-01 10:39:12 +0000
commitf44446c45d8875d5e5d6e556da8d1ff3d4452cab (patch)
treeb9434e53799d5c364bc1b7e6593cece5dd6be294 /benchmark
parent0fe64693a7d018dde9b9a5d88dd7a9eac60ea14d (diff)
* benchmark/bm_app_erb.rb: increase loop count. too short
mesurement time makes less accuracy. * benchmark/bm_app_factorial.rb: ditto. * benchmark/bm_app_mandelbrot.rb: ditto. * benchmark/bm_app_strconcat.rb: ditto. * benchmark/bm_io_file_create.rb: ditto. * benchmark/bm_io_file_read.rb: ditto. * benchmark/bm_io_file_write.rb: ditto. * benchmark/bm_so_concatenate.rb: ditto. * benchmark/bm_so_lists.rb: ditto. * benchmark/bm_so_matrix.rb: ditto. * benchmark/bm_so_random.rb: ditto. * benchmark/bm_so_sieve.rb: ditto. * benchmark/bm_vm_thread_mutex1.rb: ditto. * benchmark/bm_vm_thread_mutex2.rb: ditto. * benchmark/bm_vm_thread_mutex3.rb: ditto. * benchmark/bm_vm1_block.rb: cleanup. * benchmark/bm_vm1_const.rb: cleanup. * benchmark/bm_vm1_ensure.rb: cleanup. * benchmark/bm_vm1_ivar.rb: cleanup. * benchmark/bm_vm1_length.rb: cleanup. * benchmark/bm_vm1_neq.rb: cleanup. * benchmark/bm_vm1_not.rb: cleanup. * benchmark/bm_vm1_rescue.rb: cleanup. * benchmark/bm_vm1_simplereturn.rb: cleanup. * benchmark/bm_vm1_swap.rb: cleanup. * benchmark/bm_vm2_array.rb: cleanup. * benchmark/bm_vm2_case.rb: cleanup. * benchmark/bm_vm2_defined_method.rb: cleanup. * benchmark/bm_vm2_eval.rb: cleanup. * benchmark/bm_vm2_method.rb: cleanup. * benchmark/bm_vm2_mutex.rb: cleanup. * benchmark/bm_vm2_poly_method.rb: cleanup. * benchmark/bm_vm2_poly_method_ov.rb: cleanup. * benchmark/bm_vm2_proc.rb: cleanup. * benchmark/bm_vm2_regexp.rb: cleanup. * benchmark/bm_vm2_send.rb: cleanup. * benchmark/bm_vm2_super.rb: cleanup. * benchmark/bm_vm2_unif1.rb: cleanup. * benchmark/bm_vm2_zsuper.rb: cleanup. * benchmark/bm_vm_thread_alive_check1.rb: cleanup. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'benchmark')
-rw-r--r--benchmark/bm_app_erb.rb2
-rw-r--r--benchmark/bm_app_factorial.rb4
-rw-r--r--benchmark/bm_app_mandelbrot.rb4
-rw-r--r--benchmark/bm_app_strconcat.rb2
-rw-r--r--benchmark/bm_io_file_create.rb2
-rw-r--r--benchmark/bm_io_file_read.rb2
-rw-r--r--benchmark/bm_io_file_write.rb2
-rw-r--r--benchmark/bm_so_concatenate.rb2
-rw-r--r--benchmark/bm_so_fannkuch.rb2
-rw-r--r--benchmark/bm_so_lists.rb2
-rw-r--r--benchmark/bm_so_matrix.rb2
-rw-r--r--benchmark/bm_so_random.rb2
-rw-r--r--benchmark/bm_so_sieve.rb2
-rw-r--r--benchmark/bm_vm1_block.rb4
-rw-r--r--benchmark/bm_vm1_const.rb2
-rw-r--r--benchmark/bm_vm1_ensure.rb2
-rw-r--r--benchmark/bm_vm1_ivar.rb2
-rw-r--r--benchmark/bm_vm1_length.rb2
-rw-r--r--benchmark/bm_vm1_neq.rb2
-rw-r--r--benchmark/bm_vm1_not.rb2
-rw-r--r--benchmark/bm_vm1_rescue.rb2
-rw-r--r--benchmark/bm_vm1_simplereturn.rb2
-rw-r--r--benchmark/bm_vm1_swap.rb2
-rw-r--r--benchmark/bm_vm2_array.rb2
-rw-r--r--benchmark/bm_vm2_case.rb2
-rw-r--r--benchmark/bm_vm2_defined_method.rb2
-rw-r--r--benchmark/bm_vm2_eval.rb2
-rw-r--r--benchmark/bm_vm2_method.rb2
-rw-r--r--benchmark/bm_vm2_mutex.rb2
-rw-r--r--benchmark/bm_vm2_poly_method.rb2
-rw-r--r--benchmark/bm_vm2_poly_method_ov.rb2
-rw-r--r--benchmark/bm_vm2_proc.rb2
-rw-r--r--benchmark/bm_vm2_regexp.rb2
-rw-r--r--benchmark/bm_vm2_send.rb2
-rw-r--r--benchmark/bm_vm2_super.rb2
-rw-r--r--benchmark/bm_vm2_unif1.rb2
-rw-r--r--benchmark/bm_vm2_zsuper.rb2
-rw-r--r--benchmark/bm_vm_thread_alive_check1.rb2
-rw-r--r--benchmark/bm_vm_thread_mutex1.rb2
-rw-r--r--benchmark/bm_vm_thread_mutex2.rb2
-rw-r--r--benchmark/bm_vm_thread_mutex3.rb2
41 files changed, 44 insertions, 44 deletions
diff --git a/benchmark/bm_app_erb.rb b/benchmark/bm_app_erb.rb
index e58b7a3..77c66a7 100644
--- a/benchmark/bm_app_erb.rb
+++ b/benchmark/bm_app_erb.rb
@@ -5,7 +5,7 @@
require 'erb'
data = DATA.read
-max = 5_000
+max = 15_000
title = "hello world!"
content = "hello world!\n" * 10
diff --git a/benchmark/bm_app_factorial.rb b/benchmark/bm_app_factorial.rb
index a5a5de0..45f471d 100644
--- a/benchmark/bm_app_factorial.rb
+++ b/benchmark/bm_app_factorial.rb
@@ -6,6 +6,6 @@ def fact(n)
end
end
-8.times{
+100.times {
fact(5000)
-} \ No newline at end of file
+}
diff --git a/benchmark/bm_app_mandelbrot.rb b/benchmark/bm_app_mandelbrot.rb
index a0dcf5e..89069db 100644
--- a/benchmark/bm_app_mandelbrot.rb
+++ b/benchmark/bm_app_mandelbrot.rb
@@ -12,8 +12,8 @@ end
ary = []
-(0..100).each{|dx|
- (0..100).each{|dy|
+(0..1000).each{|dx|
+ (0..1000).each{|dy|
x = dx / 50.0
y = dy / 50.0
c = Complex(x, y)
diff --git a/benchmark/bm_app_strconcat.rb b/benchmark/bm_app_strconcat.rb
index c6ef817..7b2f2da 100644
--- a/benchmark/bm_app_strconcat.rb
+++ b/benchmark/bm_app_strconcat.rb
@@ -1,5 +1,5 @@
i=0
-while i<500000
+while i<2_000_000
"#{1+1} #{1+1} #{1+1}"
i+=1
end
diff --git a/benchmark/bm_io_file_create.rb b/benchmark/bm_io_file_create.rb
index 7adbe9e..2f205c1 100644
--- a/benchmark/bm_io_file_create.rb
+++ b/benchmark/bm_io_file_create.rb
@@ -2,7 +2,7 @@
# Create files
#
-max = 50_000
+max = 200_000
file = './tmpfile_of_bm_io_file_create'
max.times{
diff --git a/benchmark/bm_io_file_read.rb b/benchmark/bm_io_file_read.rb
index 2b4212d..b9e796e 100644
--- a/benchmark/bm_io_file_read.rb
+++ b/benchmark/bm_io_file_read.rb
@@ -4,7 +4,7 @@
require 'tempfile'
-max = 20_000
+max = 200_000
str = "Hello world! " * 1000
f = Tempfile.new('yarv-benchmark')
f.write str
diff --git a/benchmark/bm_io_file_write.rb b/benchmark/bm_io_file_write.rb
index 3cec58c..aa1be0e 100644
--- a/benchmark/bm_io_file_write.rb
+++ b/benchmark/bm_io_file_write.rb
@@ -4,7 +4,7 @@
require 'tempfile'
-max = 20_000
+max = 200_000
str = "Hello world! " * 1000
f = Tempfile.new('yarv-benchmark')
diff --git a/benchmark/bm_so_concatenate.rb b/benchmark/bm_so_concatenate.rb
index 8262968..56b9410 100644
--- a/benchmark/bm_so_concatenate.rb
+++ b/benchmark/bm_so_concatenate.rb
@@ -9,7 +9,7 @@ i=0
while i<10
i+=1
hello = ''
- 400000.times do |e|
+ 4_000_000.times do |e|
hello << STUFF
end
end
diff --git a/benchmark/bm_so_fannkuch.rb b/benchmark/bm_so_fannkuch.rb
index a214f2e..bac5ecd 100644
--- a/benchmark/bm_so_fannkuch.rb
+++ b/benchmark/bm_so_fannkuch.rb
@@ -40,6 +40,6 @@ end
def puts *args
end
-N = 10 # (ARGV[0] || 1).to_i
+N = 9 # (ARGV[0] || 1).to_i
puts "Pfannkuchen(#{N}) = #{fannkuch(N)}"
diff --git a/benchmark/bm_so_lists.rb b/benchmark/bm_so_lists.rb
index 3652288..f8d2679 100644
--- a/benchmark/bm_so_lists.rb
+++ b/benchmark/bm_so_lists.rb
@@ -1,6 +1,6 @@
#from http://www.bagley.org/~doug/shootout/bench/lists/lists.ruby
-NUM = 100
+NUM = 300
SIZE = 10000
def test_lists()
diff --git a/benchmark/bm_so_matrix.rb b/benchmark/bm_so_matrix.rb
index 0f274ad..e2c5c8e 100644
--- a/benchmark/bm_so_matrix.rb
+++ b/benchmark/bm_so_matrix.rb
@@ -5,7 +5,7 @@
n = 60 #Integer(ARGV.shift || 1)
-size = 30
+size = 40
def mkmatrix(rows, cols)
count = 1
diff --git a/benchmark/bm_so_random.rb b/benchmark/bm_so_random.rb
index 83c0d6d..57f700b 100644
--- a/benchmark/bm_so_random.rb
+++ b/benchmark/bm_so_random.rb
@@ -10,7 +10,7 @@ def gen_random(max)
(max * ($last = ($last * IA + IC) % IM)) / IM
end
-N = 1000000
+N = 3_000_000
i=0
while i<N
diff --git a/benchmark/bm_so_sieve.rb b/benchmark/bm_so_sieve.rb
index dbe2bfa..3f1b138 100644
--- a/benchmark/bm_so_sieve.rb
+++ b/benchmark/bm_so_sieve.rb
@@ -1,5 +1,5 @@
# from http://www.bagley.org/~doug/shootout/bench/sieve/sieve.ruby
-num = 40
+num = 500
count = i = j = 0
flags0 = Array.new(8192,1)
k = 0
diff --git a/benchmark/bm_vm1_block.rb b/benchmark/bm_vm1_block.rb
index 2dc4e72..0a97883 100644
--- a/benchmark/bm_vm1_block.rb
+++ b/benchmark/bm_vm1_block.rb
@@ -3,8 +3,8 @@ def m
end
i=0
-while i<30000000 # while loop 1
+while i<30_000_000 # while loop 1
i+=1
m{
}
-end \ No newline at end of file
+end
diff --git a/benchmark/bm_vm1_const.rb b/benchmark/bm_vm1_const.rb
index 3e395d9..066916d 100644
--- a/benchmark/bm_vm1_const.rb
+++ b/benchmark/bm_vm1_const.rb
@@ -1,7 +1,7 @@
Const = 1
i = 0
-while i<30000000 # while loop 1
+while i<30_000_000 # while loop 1
i+= 1
j = Const
k = Const
diff --git a/benchmark/bm_vm1_ensure.rb b/benchmark/bm_vm1_ensure.rb
index c3b71ea..b1948f7 100644
--- a/benchmark/bm_vm1_ensure.rb
+++ b/benchmark/bm_vm1_ensure.rb
@@ -1,5 +1,5 @@
i=0
-while i<30000000 # benchmark loop 1
+while i<30_000_000 # benchmark loop 1
i+=1
begin
begin
diff --git a/benchmark/bm_vm1_ivar.rb b/benchmark/bm_vm1_ivar.rb
index 4de833a..3ba5642 100644
--- a/benchmark/bm_vm1_ivar.rb
+++ b/benchmark/bm_vm1_ivar.rb
@@ -1,7 +1,7 @@
@a = 1
i = 0
-while i<30000000 # while loop 1
+while i<30_000_000 # while loop 1
i+= 1
j = @a
k = @a
diff --git a/benchmark/bm_vm1_length.rb b/benchmark/bm_vm1_length.rb
index 2d7d7f0..ccb7732 100644
--- a/benchmark/bm_vm1_length.rb
+++ b/benchmark/bm_vm1_length.rb
@@ -1,7 +1,7 @@
a = 'abc'
b = [1, 2, 3]
i=0
-while i<30000000 # while loop 1
+while i<30_000_000 # while loop 1
i+=1
a.length
b.length
diff --git a/benchmark/bm_vm1_neq.rb b/benchmark/bm_vm1_neq.rb
index 212f056..9254a0c 100644
--- a/benchmark/bm_vm1_neq.rb
+++ b/benchmark/bm_vm1_neq.rb
@@ -2,7 +2,7 @@ i = 0
obj1 = Object.new
obj2 = Object.new
-while i<30000000 # while loop 1
+while i<30_000_000 # while loop 1
i+= 1
obj1 != obj2
end
diff --git a/benchmark/bm_vm1_not.rb b/benchmark/bm_vm1_not.rb
index f139fed..ee9d0f3 100644
--- a/benchmark/bm_vm1_not.rb
+++ b/benchmark/bm_vm1_not.rb
@@ -1,7 +1,7 @@
i = 0
obj = Object.new
-while i<30000000 # while loop 1
+while i<30_000_000 # while loop 1
i+= 1
!obj
end
diff --git a/benchmark/bm_vm1_rescue.rb b/benchmark/bm_vm1_rescue.rb
index 0c98d00..3af12bb 100644
--- a/benchmark/bm_vm1_rescue.rb
+++ b/benchmark/bm_vm1_rescue.rb
@@ -1,5 +1,5 @@
i=0
-while i<30000000 # while loop 1
+while i<30_000_000 # while loop 1
i+=1
begin
rescue
diff --git a/benchmark/bm_vm1_simplereturn.rb b/benchmark/bm_vm1_simplereturn.rb
index c843ee3..8e9bcb0 100644
--- a/benchmark/bm_vm1_simplereturn.rb
+++ b/benchmark/bm_vm1_simplereturn.rb
@@ -2,7 +2,7 @@ def m
return 1
end
i=0
-while i<30000000 # while loop 1
+while i<30_000_000 # while loop 1
i+=1
m
end
diff --git a/benchmark/bm_vm1_swap.rb b/benchmark/bm_vm1_swap.rb
index a565b6f..611baf6 100644
--- a/benchmark/bm_vm1_swap.rb
+++ b/benchmark/bm_vm1_swap.rb
@@ -1,7 +1,7 @@
a = 1
b = 2
i=0
-while i<30000000 # while loop 1
+while i<30_000_000 # while loop 1
i+=1
a, b = b, a
end
diff --git a/benchmark/bm_vm2_array.rb b/benchmark/bm_vm2_array.rb
index e29c112..7713ae9 100644
--- a/benchmark/bm_vm2_array.rb
+++ b/benchmark/bm_vm2_array.rb
@@ -1,5 +1,5 @@
i=0
-while i<6000000 # benchmark loop 2
+while i<6_000_000 # benchmark loop 2
i+=1
a = [1,2,3,4,5,6,7,8,9,10]
end
diff --git a/benchmark/bm_vm2_case.rb b/benchmark/bm_vm2_case.rb
index 1ec34ad..cd09788 100644
--- a/benchmark/bm_vm2_case.rb
+++ b/benchmark/bm_vm2_case.rb
@@ -1,5 +1,5 @@
i=0
-while i<6000000 # while loop 2
+while i<6_000_000 # while loop 2
case :foo
when :bar
raise
diff --git a/benchmark/bm_vm2_defined_method.rb b/benchmark/bm_vm2_defined_method.rb
index a14c43f..06c0d01 100644
--- a/benchmark/bm_vm2_defined_method.rb
+++ b/benchmark/bm_vm2_defined_method.rb
@@ -3,7 +3,7 @@ class Object
end
i=0
-while i<6000000 # benchmark loop 2
+while i<6_000_000 # benchmark loop 2
i+=1
m; m; m; m; m; m; m; m;
end
diff --git a/benchmark/bm_vm2_eval.rb b/benchmark/bm_vm2_eval.rb
index 375dccc..e72b466 100644
--- a/benchmark/bm_vm2_eval.rb
+++ b/benchmark/bm_vm2_eval.rb
@@ -1,5 +1,5 @@
i=0
-while i<6000000 # benchmark loop 2
+while i<6_000_000 # benchmark loop 2
i+=1
eval("1")
end
diff --git a/benchmark/bm_vm2_method.rb b/benchmark/bm_vm2_method.rb
index cc94b8a..f92e39a 100644
--- a/benchmark/bm_vm2_method.rb
+++ b/benchmark/bm_vm2_method.rb
@@ -3,7 +3,7 @@ def m
end
i=0
-while i<6000000 # benchmark loop 2
+while i<6_000_000 # benchmark loop 2
i+=1
m; m; m; m; m; m; m; m;
end
diff --git a/benchmark/bm_vm2_mutex.rb b/benchmark/bm_vm2_mutex.rb
index 9ec1a0f..01b1c47 100644
--- a/benchmark/bm_vm2_mutex.rb
+++ b/benchmark/bm_vm2_mutex.rb
@@ -3,7 +3,7 @@ require 'thread'
m = Mutex.new
i=0
-while i<6000000 # benchmark loop 2
+while i<6_000_000 # benchmark loop 2
i+=1
m.synchronize{}
end
diff --git a/benchmark/bm_vm2_poly_method.rb b/benchmark/bm_vm2_poly_method.rb
index ac9953c..921457d 100644
--- a/benchmark/bm_vm2_poly_method.rb
+++ b/benchmark/bm_vm2_poly_method.rb
@@ -13,7 +13,7 @@ o1 = C1.new
o2 = C2.new
i=0
-while i<6000000 # benchmark loop 2
+while i<6_000_000 # benchmark loop 2
o = (i % 2 == 0) ? o1 : o2
o.m; o.m; o.m; o.m; o.m; o.m; o.m; o.m
i+=1
diff --git a/benchmark/bm_vm2_poly_method_ov.rb b/benchmark/bm_vm2_poly_method_ov.rb
index 856ba9b..bf09837 100644
--- a/benchmark/bm_vm2_poly_method_ov.rb
+++ b/benchmark/bm_vm2_poly_method_ov.rb
@@ -13,7 +13,7 @@ o1 = C1.new
o2 = C2.new
i=0
-while i<6000000 # benchmark loop 2
+while i<6_000_000 # benchmark loop 2
o = (i % 2 == 0) ? o1 : o2
# o.m; o.m; o.m; o.m; o.m; o.m; o.m; o.m
i+=1
diff --git a/benchmark/bm_vm2_proc.rb b/benchmark/bm_vm2_proc.rb
index 0bd05b9..3f51056 100644
--- a/benchmark/bm_vm2_proc.rb
+++ b/benchmark/bm_vm2_proc.rb
@@ -7,7 +7,7 @@ pr = m{
}
i=0
-while i<6000000 # benchmark loop 2
+while i<6_000_000 # benchmark loop 2
i+=1
pr.call
end
diff --git a/benchmark/bm_vm2_regexp.rb b/benchmark/bm_vm2_regexp.rb
index 44f6ed4..428099e 100644
--- a/benchmark/bm_vm2_regexp.rb
+++ b/benchmark/bm_vm2_regexp.rb
@@ -1,6 +1,6 @@
i=0
str = 'xxxhogexxx'
-while i<6000000 # benchmark loop 2
+while i<6_000_000 # benchmark loop 2
/hoge/ =~ str
i+=1
end
diff --git a/benchmark/bm_vm2_send.rb b/benchmark/bm_vm2_send.rb
index c20dbdd..37c79fb 100644
--- a/benchmark/bm_vm2_send.rb
+++ b/benchmark/bm_vm2_send.rb
@@ -6,7 +6,7 @@ end
o = C.new
i=0
-while i<6000000 # benchmark loop 2
+while i<6_000_000 # benchmark loop 2
i+=1
o.__send__ :m
end
diff --git a/benchmark/bm_vm2_super.rb b/benchmark/bm_vm2_super.rb
index 70c86b3..d4f0b64 100644
--- a/benchmark/bm_vm2_super.rb
+++ b/benchmark/bm_vm2_super.rb
@@ -14,7 +14,7 @@ end
obj = CC.new
i = 0
-while i<6000000 # benchmark loop 2
+while i<6_000_000 # benchmark loop 2
obj.m
i+=1
end
diff --git a/benchmark/bm_vm2_unif1.rb b/benchmark/bm_vm2_unif1.rb
index e12bd2a..775f4d3 100644
--- a/benchmark/bm_vm2_unif1.rb
+++ b/benchmark/bm_vm2_unif1.rb
@@ -2,7 +2,7 @@ i = 0
def m a, b
end
-while i<6000000 # benchmark loop 2
+while i<6_000_000 # benchmark loop 2
i+=1
m 100, 200
end
diff --git a/benchmark/bm_vm2_zsuper.rb b/benchmark/bm_vm2_zsuper.rb
index 3a75960..7e90df1 100644
--- a/benchmark/bm_vm2_zsuper.rb
+++ b/benchmark/bm_vm2_zsuper.rb
@@ -14,7 +14,7 @@ end
obj = CC.new
-while i<6000000 # benchmark loop 2
+while i<6_000_000 # benchmark loop 2
obj.m 10
i+=1
end
diff --git a/benchmark/bm_vm_thread_alive_check1.rb b/benchmark/bm_vm_thread_alive_check1.rb
index aebe998..c993acc 100644
--- a/benchmark/bm_vm_thread_alive_check1.rb
+++ b/benchmark/bm_vm_thread_alive_check1.rb
@@ -1,4 +1,4 @@
-5000.times{
+5_000.times{
t = Thread.new{}
while t.alive?
Thread.pass
diff --git a/benchmark/bm_vm_thread_mutex1.rb b/benchmark/bm_vm_thread_mutex1.rb
index faf8da1..588506e 100644
--- a/benchmark/bm_vm_thread_mutex1.rb
+++ b/benchmark/bm_vm_thread_mutex1.rb
@@ -3,7 +3,7 @@
require 'thread'
m = Mutex.new
r = 0
-max = 1000
+max = 2000
lmax = max * max
(1..1).map{
Thread.new{
diff --git a/benchmark/bm_vm_thread_mutex2.rb b/benchmark/bm_vm_thread_mutex2.rb
index a74e2fd..d700b14 100644
--- a/benchmark/bm_vm_thread_mutex2.rb
+++ b/benchmark/bm_vm_thread_mutex2.rb
@@ -3,7 +3,7 @@
require 'thread'
m = Mutex.new
r = 0
-max = 1000
+max = 2000
lmax = (max * max)/2
(1..2).map{
Thread.new{
diff --git a/benchmark/bm_vm_thread_mutex3.rb b/benchmark/bm_vm_thread_mutex3.rb
index ae02e20..f502b6a 100644
--- a/benchmark/bm_vm_thread_mutex3.rb
+++ b/benchmark/bm_vm_thread_mutex3.rb
@@ -3,7 +3,7 @@
require 'thread'
m = Mutex.new
r = 0
-max = 1000
+max = 2000
(1..max).map{
Thread.new{
i=0