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>
|
||||
|
||||
* lib/matrix: Add LUP decomposition
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
require 'erb'
|
||||
|
||||
data = DATA.read
|
||||
max = 5_000
|
||||
max = 15_000
|
||||
title = "hello world!"
|
||||
content = "hello world!\n" * 10
|
||||
|
||||
|
|
|
@ -6,6 +6,6 @@ def fact(n)
|
|||
end
|
||||
end
|
||||
|
||||
8.times{
|
||||
100.times {
|
||||
fact(5000)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
i=0
|
||||
while i<500000
|
||||
while i<2_000_000
|
||||
"#{1+1} #{1+1} #{1+1}"
|
||||
i+=1
|
||||
end
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# Create files
|
||||
#
|
||||
|
||||
max = 50_000
|
||||
max = 200_000
|
||||
file = './tmpfile_of_bm_io_file_create'
|
||||
|
||||
max.times{
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
require 'tempfile'
|
||||
|
||||
max = 20_000
|
||||
max = 200_000
|
||||
str = "Hello world! " * 1000
|
||||
f = Tempfile.new('yarv-benchmark')
|
||||
f.write str
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
require 'tempfile'
|
||||
|
||||
max = 20_000
|
||||
max = 200_000
|
||||
str = "Hello world! " * 1000
|
||||
f = Tempfile.new('yarv-benchmark')
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)}"
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#from http://www.bagley.org/~doug/shootout/bench/lists/lists.ruby
|
||||
|
||||
NUM = 100
|
||||
NUM = 300
|
||||
SIZE = 10000
|
||||
|
||||
def test_lists()
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
n = 60 #Integer(ARGV.shift || 1)
|
||||
|
||||
size = 30
|
||||
size = 40
|
||||
|
||||
def mkmatrix(rows, cols)
|
||||
count = 1
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
end
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
i=0
|
||||
while i<30000000 # benchmark loop 1
|
||||
while i<30_000_000 # benchmark loop 1
|
||||
i+=1
|
||||
begin
|
||||
begin
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
i=0
|
||||
while i<30000000 # while loop 1
|
||||
while i<30_000_000 # while loop 1
|
||||
i+=1
|
||||
begin
|
||||
rescue
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
5000.times{
|
||||
5_000.times{
|
||||
t = Thread.new{}
|
||||
while t.alive?
|
||||
Thread.pass
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
require 'thread'
|
||||
m = Mutex.new
|
||||
r = 0
|
||||
max = 1000
|
||||
max = 2000
|
||||
lmax = max * max
|
||||
(1..1).map{
|
||||
Thread.new{
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
require 'thread'
|
||||
m = Mutex.new
|
||||
r = 0
|
||||
max = 1000
|
||||
max = 2000
|
||||
lmax = (max * max)/2
|
||||
(1..2).map{
|
||||
Thread.new{
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
require 'thread'
|
||||
m = Mutex.new
|
||||
r = 0
|
||||
max = 1000
|
||||
max = 2000
|
||||
(1..max).map{
|
||||
Thread.new{
|
||||
i=0
|
||||
|
|
Loading…
Reference in a new issue