yarv-diff:30
From: ko1 atdot.net
Date: 29 Jun 2005 13:29:51 -0000
Subject: [yarv-diff:30] r185 - trunk/benchmark
Author: ko1
Date: 2005-06-29 22:29:51 +0900 (Wed, 29 Jun 2005)
New Revision: 185
Added:
trunk/benchmark/bm_loop_times.rb
trunk/benchmark/bm_loop_whileloop.rb
trunk/benchmark/bm_so_lists.rb
Removed:
trunk/benchmark/bm_lists.rb
trunk/benchmark/bm_reccount.rb
trunk/benchmark/bm_times.rb
trunk/benchmark/bm_whileloop.rb
Modified:
trunk/benchmark/bm_array.rb
trunk/benchmark/bm_block.rb
trunk/benchmark/bm_const.rb
trunk/benchmark/bm_ensure.rb
trunk/benchmark/bm_method.rb
trunk/benchmark/bm_poly_method.rb
trunk/benchmark/bm_proc.rb
trunk/benchmark/bm_regexp.rb
trunk/benchmark/bm_rescue.rb
Log:
fix benchmark loop count
Modified: trunk/benchmark/bm_array.rb
===================================================================
--- trunk/benchmark/bm_array.rb 2005-06-29 07:19:03 UTC (rev 184)
+++ trunk/benchmark/bm_array.rb 2005-06-29 13:29:51 UTC (rev 185)
@@ -1,5 +1,5 @@
i=0
-while i<10000000
+while i<6000000 # benchmark loop 2
i+=1
a = [1,2,3,4,5,6,7,8,9,10]
end
Modified: trunk/benchmark/bm_block.rb
===================================================================
--- trunk/benchmark/bm_block.rb 2005-06-29 07:19:03 UTC (rev 184)
+++ trunk/benchmark/bm_block.rb 2005-06-29 13:29:51 UTC (rev 185)
@@ -3,7 +3,7 @@
end
i=0
-while i<1000000
+while i<30000000 # while loop 1
i+=1
m{
}
Modified: trunk/benchmark/bm_const.rb
===================================================================
--- trunk/benchmark/bm_const.rb 2005-06-29 07:19:03 UTC (rev 184)
+++ trunk/benchmark/bm_const.rb 2005-06-29 13:29:51 UTC (rev 185)
@@ -1,7 +1,7 @@
Const = 1
i = 0
-while i < 10000000
+while i<30000000 # while loop 1
i+= 1
j = Const
k = Const
Modified: trunk/benchmark/bm_ensure.rb
===================================================================
--- trunk/benchmark/bm_ensure.rb 2005-06-29 07:19:03 UTC (rev 184)
+++ trunk/benchmark/bm_ensure.rb 2005-06-29 13:29:51 UTC (rev 185)
@@ -1,5 +1,5 @@
i=0
-while i<1000000
+while i<30000000 # benchmark loop 1
i+=1
begin
begin
Deleted: trunk/benchmark/bm_lists.rb
===================================================================
--- trunk/benchmark/bm_lists.rb 2005-06-29 07:19:03 UTC (rev 184)
+++ trunk/benchmark/bm_lists.rb 2005-06-29 13:29:51 UTC (rev 185)
@@ -1,47 +0,0 @@
-#from http://www.bagley.org/~doug/shootout/bench/lists/lists.ruby
-
-NUM = 10
-SIZE = 10000
-
-def test_lists()
- # create a list of integers (Li1) from 1 to SIZE
- li1 = (1..SIZE).to_a
- # copy the list to li2 (not by individual items)
- li2 = li1.dup
- # remove each individual item from left side of li2 and
- # append to right side of li3 (preserving order)
- li3 = Array.new
- while (not li2.empty?)
- li3.push(li2.shift)
- end
- # li2 must now be empty
- # remove each individual item from right side of li3 and
- # append to right side of li2 (reversing list)
- while (not li3.empty?)
- li2.push(li3.pop)
- end
- # li3 must now be empty
- # reverse li1 in place
- li1.reverse!
- # check that first item is now SIZE
- if li1[0] != SIZE then
- p "not SIZE"
- 0
- else
- # compare li1 and li2 for equality
- if li1 != li2 then
- return(0)
- else
- # return the length of the list
- li1.length
- end
- end
-end
-
-i = 0
-while i<NUM
- i+=1
- result = test_lists()
-end
-
-result
Copied: trunk/benchmark/bm_loop_times.rb (from rev 184, trunk/benchmark/bm_times.rb)
Copied: trunk/benchmark/bm_loop_whileloop.rb (from rev 184, trunk/benchmark/bm_whileloop.rb)
Modified: trunk/benchmark/bm_method.rb
===================================================================
--- trunk/benchmark/bm_method.rb 2005-06-29 07:19:03 UTC (rev 184)
+++ trunk/benchmark/bm_method.rb 2005-06-29 13:29:51 UTC (rev 185)
@@ -2,7 +2,7 @@
end
i=0
-while i<1000000
+while i<6000000 # benchmark loop 2
i+=1
m; m; m; m; m; m; m; m; m; m
end
Modified: trunk/benchmark/bm_poly_method.rb
===================================================================
--- trunk/benchmark/bm_poly_method.rb 2005-06-29 07:19:03 UTC (rev 184)
+++ trunk/benchmark/bm_poly_method.rb 2005-06-29 13:29:51 UTC (rev 185)
@@ -13,7 +13,7 @@
o2 = C2.new
i=0
-while i< 1000000
+while i<6000000 # 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; o.m; o.m
i+=1
Modified: trunk/benchmark/bm_proc.rb
===================================================================
--- trunk/benchmark/bm_proc.rb 2005-06-29 07:19:03 UTC (rev 184)
+++ trunk/benchmark/bm_proc.rb 2005-06-29 13:29:51 UTC (rev 185)
@@ -7,7 +7,7 @@
}
i=0
-while i<1000000
+while i<6000000 # benchmark loop 2
i+=1
pr.call
end
Deleted: trunk/benchmark/bm_reccount.rb
===================================================================
--- trunk/benchmark/bm_reccount.rb 2005-06-29 07:19:03 UTC (rev 184)
+++ trunk/benchmark/bm_reccount.rb 2005-06-29 13:29:51 UTC (rev 185)
@@ -1,10 +0,0 @@
-def reccount n
- if n > 1
- 1 + reccount(n-1)
- else
- 1
- end
-end
-
-reccount 7000
-
Modified: trunk/benchmark/bm_regexp.rb
===================================================================
--- trunk/benchmark/bm_regexp.rb 2005-06-29 07:19:03 UTC (rev 184)
+++ trunk/benchmark/bm_regexp.rb 2005-06-29 13:29:51 UTC (rev 185)
@@ -1,5 +1,6 @@
i=0
-while i<1000000
- /hoge/ =~ 'xxxhogexxx'
+str = 'xxxhogexxx'
+while i<6000000 # benchmark loop 2
+ /hoge/ =~ str
i+=1
end
Modified: trunk/benchmark/bm_rescue.rb
===================================================================
--- trunk/benchmark/bm_rescue.rb 2005-06-29 07:19:03 UTC (rev 184)
+++ trunk/benchmark/bm_rescue.rb 2005-06-29 13:29:51 UTC (rev 185)
@@ -1,5 +1,5 @@
i=0
-while i<10000000
+while i<6000000 # benchmark loop 2
i+=1
begin
rescue
Copied: trunk/benchmark/bm_so_lists.rb (from rev 184, trunk/benchmark/bm_lists.rb)
Deleted: trunk/benchmark/bm_times.rb
===================================================================
--- trunk/benchmark/bm_times.rb 2005-06-29 07:19:03 UTC (rev 184)
+++ trunk/benchmark/bm_times.rb 2005-06-29 13:29:51 UTC (rev 185)
@@ -1,2 +0,0 @@
-10000000.times{|i|
-}
Deleted: trunk/benchmark/bm_whileloop.rb
===================================================================
--- trunk/benchmark/bm_whileloop.rb 2005-06-29 07:19:03 UTC (rev 184)
+++ trunk/benchmark/bm_whileloop.rb 2005-06-29 13:29:51 UTC (rev 185)
@@ -1,4 +0,0 @@
-i = 0
-while i<30000000
- i+=1
-end
--
ML: yarv-diff quickml.atdot.net
Info: http://www.atdot.net/~ko1/quickml