mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
0fe64693a7
commit
f44446c45d
42 changed files with 94 additions and 44 deletions
50
ChangeLog
50
ChangeLog
|
@ -1,3 +1,53 @@
|
||||||
|
Fri Jul 1 18:52:31 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
Fri Jul 1 15:23:00 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
|
Fri Jul 1 15:23:00 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
|
||||||
|
|
||||||
* lib/matrix: Add LUP decomposition
|
* lib/matrix: Add LUP decomposition
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
require 'erb'
|
require 'erb'
|
||||||
|
|
||||||
data = DATA.read
|
data = DATA.read
|
||||||
max = 5_000
|
max = 15_000
|
||||||
title = "hello world!"
|
title = "hello world!"
|
||||||
content = "hello world!\n" * 10
|
content = "hello world!\n" * 10
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,6 @@ def fact(n)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
8.times{
|
100.times {
|
||||||
fact(5000)
|
fact(5000)
|
||||||
}
|
}
|
|
@ -12,8 +12,8 @@ end
|
||||||
|
|
||||||
ary = []
|
ary = []
|
||||||
|
|
||||||
(0..100).each{|dx|
|
(0..1000).each{|dx|
|
||||||
(0..100).each{|dy|
|
(0..1000).each{|dy|
|
||||||
x = dx / 50.0
|
x = dx / 50.0
|
||||||
y = dy / 50.0
|
y = dy / 50.0
|
||||||
c = Complex(x, y)
|
c = Complex(x, y)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
i=0
|
i=0
|
||||||
while i<500000
|
while i<2_000_000
|
||||||
"#{1+1} #{1+1} #{1+1}"
|
"#{1+1} #{1+1} #{1+1}"
|
||||||
i+=1
|
i+=1
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# Create files
|
# Create files
|
||||||
#
|
#
|
||||||
|
|
||||||
max = 50_000
|
max = 200_000
|
||||||
file = './tmpfile_of_bm_io_file_create'
|
file = './tmpfile_of_bm_io_file_create'
|
||||||
|
|
||||||
max.times{
|
max.times{
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
require 'tempfile'
|
require 'tempfile'
|
||||||
|
|
||||||
max = 20_000
|
max = 200_000
|
||||||
str = "Hello world! " * 1000
|
str = "Hello world! " * 1000
|
||||||
f = Tempfile.new('yarv-benchmark')
|
f = Tempfile.new('yarv-benchmark')
|
||||||
f.write str
|
f.write str
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
require 'tempfile'
|
require 'tempfile'
|
||||||
|
|
||||||
max = 20_000
|
max = 200_000
|
||||||
str = "Hello world! " * 1000
|
str = "Hello world! " * 1000
|
||||||
f = Tempfile.new('yarv-benchmark')
|
f = Tempfile.new('yarv-benchmark')
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ i=0
|
||||||
while i<10
|
while i<10
|
||||||
i+=1
|
i+=1
|
||||||
hello = ''
|
hello = ''
|
||||||
400000.times do |e|
|
4_000_000.times do |e|
|
||||||
hello << STUFF
|
hello << STUFF
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -40,6 +40,6 @@ end
|
||||||
def puts *args
|
def puts *args
|
||||||
end
|
end
|
||||||
|
|
||||||
N = 10 # (ARGV[0] || 1).to_i
|
N = 9 # (ARGV[0] || 1).to_i
|
||||||
puts "Pfannkuchen(#{N}) = #{fannkuch(N)}"
|
puts "Pfannkuchen(#{N}) = #{fannkuch(N)}"
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#from http://www.bagley.org/~doug/shootout/bench/lists/lists.ruby
|
#from http://www.bagley.org/~doug/shootout/bench/lists/lists.ruby
|
||||||
|
|
||||||
NUM = 100
|
NUM = 300
|
||||||
SIZE = 10000
|
SIZE = 10000
|
||||||
|
|
||||||
def test_lists()
|
def test_lists()
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
n = 60 #Integer(ARGV.shift || 1)
|
n = 60 #Integer(ARGV.shift || 1)
|
||||||
|
|
||||||
size = 30
|
size = 40
|
||||||
|
|
||||||
def mkmatrix(rows, cols)
|
def mkmatrix(rows, cols)
|
||||||
count = 1
|
count = 1
|
||||||
|
|
|
@ -10,7 +10,7 @@ def gen_random(max)
|
||||||
(max * ($last = ($last * IA + IC) % IM)) / IM
|
(max * ($last = ($last * IA + IC) % IM)) / IM
|
||||||
end
|
end
|
||||||
|
|
||||||
N = 1000000
|
N = 3_000_000
|
||||||
|
|
||||||
i=0
|
i=0
|
||||||
while i<N
|
while i<N
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# from http://www.bagley.org/~doug/shootout/bench/sieve/sieve.ruby
|
# from http://www.bagley.org/~doug/shootout/bench/sieve/sieve.ruby
|
||||||
num = 40
|
num = 500
|
||||||
count = i = j = 0
|
count = i = j = 0
|
||||||
flags0 = Array.new(8192,1)
|
flags0 = Array.new(8192,1)
|
||||||
k = 0
|
k = 0
|
||||||
|
|
|
@ -3,7 +3,7 @@ def m
|
||||||
end
|
end
|
||||||
|
|
||||||
i=0
|
i=0
|
||||||
while i<30000000 # while loop 1
|
while i<30_000_000 # while loop 1
|
||||||
i+=1
|
i+=1
|
||||||
m{
|
m{
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
Const = 1
|
Const = 1
|
||||||
|
|
||||||
i = 0
|
i = 0
|
||||||
while i<30000000 # while loop 1
|
while i<30_000_000 # while loop 1
|
||||||
i+= 1
|
i+= 1
|
||||||
j = Const
|
j = Const
|
||||||
k = Const
|
k = Const
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
i=0
|
i=0
|
||||||
while i<30000000 # benchmark loop 1
|
while i<30_000_000 # benchmark loop 1
|
||||||
i+=1
|
i+=1
|
||||||
begin
|
begin
|
||||||
begin
|
begin
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
@a = 1
|
@a = 1
|
||||||
|
|
||||||
i = 0
|
i = 0
|
||||||
while i<30000000 # while loop 1
|
while i<30_000_000 # while loop 1
|
||||||
i+= 1
|
i+= 1
|
||||||
j = @a
|
j = @a
|
||||||
k = @a
|
k = @a
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
a = 'abc'
|
a = 'abc'
|
||||||
b = [1, 2, 3]
|
b = [1, 2, 3]
|
||||||
i=0
|
i=0
|
||||||
while i<30000000 # while loop 1
|
while i<30_000_000 # while loop 1
|
||||||
i+=1
|
i+=1
|
||||||
a.length
|
a.length
|
||||||
b.length
|
b.length
|
||||||
|
|
|
@ -2,7 +2,7 @@ i = 0
|
||||||
obj1 = Object.new
|
obj1 = Object.new
|
||||||
obj2 = Object.new
|
obj2 = Object.new
|
||||||
|
|
||||||
while i<30000000 # while loop 1
|
while i<30_000_000 # while loop 1
|
||||||
i+= 1
|
i+= 1
|
||||||
obj1 != obj2
|
obj1 != obj2
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
i = 0
|
i = 0
|
||||||
obj = Object.new
|
obj = Object.new
|
||||||
|
|
||||||
while i<30000000 # while loop 1
|
while i<30_000_000 # while loop 1
|
||||||
i+= 1
|
i+= 1
|
||||||
!obj
|
!obj
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
i=0
|
i=0
|
||||||
while i<30000000 # while loop 1
|
while i<30_000_000 # while loop 1
|
||||||
i+=1
|
i+=1
|
||||||
begin
|
begin
|
||||||
rescue
|
rescue
|
||||||
|
|
|
@ -2,7 +2,7 @@ def m
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
i=0
|
i=0
|
||||||
while i<30000000 # while loop 1
|
while i<30_000_000 # while loop 1
|
||||||
i+=1
|
i+=1
|
||||||
m
|
m
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
a = 1
|
a = 1
|
||||||
b = 2
|
b = 2
|
||||||
i=0
|
i=0
|
||||||
while i<30000000 # while loop 1
|
while i<30_000_000 # while loop 1
|
||||||
i+=1
|
i+=1
|
||||||
a, b = b, a
|
a, b = b, a
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
i=0
|
i=0
|
||||||
while i<6000000 # benchmark loop 2
|
while i<6_000_000 # benchmark loop 2
|
||||||
i+=1
|
i+=1
|
||||||
a = [1,2,3,4,5,6,7,8,9,10]
|
a = [1,2,3,4,5,6,7,8,9,10]
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
i=0
|
i=0
|
||||||
while i<6000000 # while loop 2
|
while i<6_000_000 # while loop 2
|
||||||
case :foo
|
case :foo
|
||||||
when :bar
|
when :bar
|
||||||
raise
|
raise
|
||||||
|
|
|
@ -3,7 +3,7 @@ class Object
|
||||||
end
|
end
|
||||||
|
|
||||||
i=0
|
i=0
|
||||||
while i<6000000 # benchmark loop 2
|
while i<6_000_000 # benchmark loop 2
|
||||||
i+=1
|
i+=1
|
||||||
m; m; m; m; m; m; m; m;
|
m; m; m; m; m; m; m; m;
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
i=0
|
i=0
|
||||||
while i<6000000 # benchmark loop 2
|
while i<6_000_000 # benchmark loop 2
|
||||||
i+=1
|
i+=1
|
||||||
eval("1")
|
eval("1")
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,7 +3,7 @@ def m
|
||||||
end
|
end
|
||||||
|
|
||||||
i=0
|
i=0
|
||||||
while i<6000000 # benchmark loop 2
|
while i<6_000_000 # benchmark loop 2
|
||||||
i+=1
|
i+=1
|
||||||
m; m; m; m; m; m; m; m;
|
m; m; m; m; m; m; m; m;
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,7 +3,7 @@ require 'thread'
|
||||||
m = Mutex.new
|
m = Mutex.new
|
||||||
|
|
||||||
i=0
|
i=0
|
||||||
while i<6000000 # benchmark loop 2
|
while i<6_000_000 # benchmark loop 2
|
||||||
i+=1
|
i+=1
|
||||||
m.synchronize{}
|
m.synchronize{}
|
||||||
end
|
end
|
||||||
|
|
|
@ -13,7 +13,7 @@ o1 = C1.new
|
||||||
o2 = C2.new
|
o2 = C2.new
|
||||||
|
|
||||||
i=0
|
i=0
|
||||||
while i<6000000 # benchmark loop 2
|
while i<6_000_000 # benchmark loop 2
|
||||||
o = (i % 2 == 0) ? o1 : o2
|
o = (i % 2 == 0) ? o1 : o2
|
||||||
o.m; o.m; o.m; o.m; o.m; o.m; o.m; o.m
|
o.m; o.m; o.m; o.m; o.m; o.m; o.m; o.m
|
||||||
i+=1
|
i+=1
|
||||||
|
|
|
@ -13,7 +13,7 @@ o1 = C1.new
|
||||||
o2 = C2.new
|
o2 = C2.new
|
||||||
|
|
||||||
i=0
|
i=0
|
||||||
while i<6000000 # benchmark loop 2
|
while i<6_000_000 # benchmark loop 2
|
||||||
o = (i % 2 == 0) ? o1 : o2
|
o = (i % 2 == 0) ? o1 : o2
|
||||||
# o.m; o.m; o.m; o.m; o.m; o.m; o.m; o.m
|
# o.m; o.m; o.m; o.m; o.m; o.m; o.m; o.m
|
||||||
i+=1
|
i+=1
|
||||||
|
|
|
@ -7,7 +7,7 @@ pr = m{
|
||||||
}
|
}
|
||||||
|
|
||||||
i=0
|
i=0
|
||||||
while i<6000000 # benchmark loop 2
|
while i<6_000_000 # benchmark loop 2
|
||||||
i+=1
|
i+=1
|
||||||
pr.call
|
pr.call
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
i=0
|
i=0
|
||||||
str = 'xxxhogexxx'
|
str = 'xxxhogexxx'
|
||||||
while i<6000000 # benchmark loop 2
|
while i<6_000_000 # benchmark loop 2
|
||||||
/hoge/ =~ str
|
/hoge/ =~ str
|
||||||
i+=1
|
i+=1
|
||||||
end
|
end
|
||||||
|
|
|
@ -6,7 +6,7 @@ end
|
||||||
o = C.new
|
o = C.new
|
||||||
|
|
||||||
i=0
|
i=0
|
||||||
while i<6000000 # benchmark loop 2
|
while i<6_000_000 # benchmark loop 2
|
||||||
i+=1
|
i+=1
|
||||||
o.__send__ :m
|
o.__send__ :m
|
||||||
end
|
end
|
||||||
|
|
|
@ -14,7 +14,7 @@ end
|
||||||
obj = CC.new
|
obj = CC.new
|
||||||
|
|
||||||
i = 0
|
i = 0
|
||||||
while i<6000000 # benchmark loop 2
|
while i<6_000_000 # benchmark loop 2
|
||||||
obj.m
|
obj.m
|
||||||
i+=1
|
i+=1
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,7 +2,7 @@ i = 0
|
||||||
def m a, b
|
def m a, b
|
||||||
end
|
end
|
||||||
|
|
||||||
while i<6000000 # benchmark loop 2
|
while i<6_000_000 # benchmark loop 2
|
||||||
i+=1
|
i+=1
|
||||||
m 100, 200
|
m 100, 200
|
||||||
end
|
end
|
||||||
|
|
|
@ -14,7 +14,7 @@ end
|
||||||
|
|
||||||
obj = CC.new
|
obj = CC.new
|
||||||
|
|
||||||
while i<6000000 # benchmark loop 2
|
while i<6_000_000 # benchmark loop 2
|
||||||
obj.m 10
|
obj.m 10
|
||||||
i+=1
|
i+=1
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
5000.times{
|
5_000.times{
|
||||||
t = Thread.new{}
|
t = Thread.new{}
|
||||||
while t.alive?
|
while t.alive?
|
||||||
Thread.pass
|
Thread.pass
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
require 'thread'
|
require 'thread'
|
||||||
m = Mutex.new
|
m = Mutex.new
|
||||||
r = 0
|
r = 0
|
||||||
max = 1000
|
max = 2000
|
||||||
lmax = max * max
|
lmax = max * max
|
||||||
(1..1).map{
|
(1..1).map{
|
||||||
Thread.new{
|
Thread.new{
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
require 'thread'
|
require 'thread'
|
||||||
m = Mutex.new
|
m = Mutex.new
|
||||||
r = 0
|
r = 0
|
||||||
max = 1000
|
max = 2000
|
||||||
lmax = (max * max)/2
|
lmax = (max * max)/2
|
||||||
(1..2).map{
|
(1..2).map{
|
||||||
Thread.new{
|
Thread.new{
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
require 'thread'
|
require 'thread'
|
||||||
m = Mutex.new
|
m = Mutex.new
|
||||||
r = 0
|
r = 0
|
||||||
max = 1000
|
max = 2000
|
||||||
(1..max).map{
|
(1..max).map{
|
||||||
Thread.new{
|
Thread.new{
|
||||||
i=0
|
i=0
|
||||||
|
|
Loading…
Reference in a new issue