[前][次][番号順一覧][スレッド一覧]

ruby-changes:29428

From: ko1 <ko1@a...>
Date: Thu, 20 Jun 2013 16:30:53 +0900 (JST)
Subject: [ruby-changes:29428] ko1:r41480 (trunk): * benchmark/bm_so_binary_trees.rb: disable `puts' method

ko1	2013-06-20 16:30:41 +0900 (Thu, 20 Jun 2013)

  New Revision: 41480

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=41480

  Log:
    * benchmark/bm_so_binary_trees.rb: disable `puts' method
      and change iteration parameter to increase execution time.
    * benchmark/gc/binarytree.rb: added.

  Added files:
    trunk/benchmark/gc/binary_trees.rb
  Modified files:
    trunk/ChangeLog
    trunk/benchmark/bm_so_binary_trees.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 41479)
+++ ChangeLog	(revision 41480)
@@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Jun 20 16:28:33 2013  Koichi Sasada  <ko1@a...>
+
+	* benchmark/bm_so_binary_trees.rb: disable `puts' method
+	  and change iteration parameter to increase execution time.
+
+	* benchmark/gc/binarytree.rb: added.
+
 Thu Jun 20 16:06:37 2013  Koichi Sasada  <ko1@a...>
 
 	* benchmark/gc/pentomino.rb: added.
Index: benchmark/gc/binary_trees.rb
===================================================================
--- benchmark/gc/binary_trees.rb	(revision 0)
+++ benchmark/gc/binary_trees.rb	(revision 41480)
@@ -0,0 +1 @@
+require_relative '../bm_so_binary_trees.rb'
Index: benchmark/bm_so_binary_trees.rb
===================================================================
--- benchmark/bm_so_binary_trees.rb	(revision 41479)
+++ benchmark/bm_so_binary_trees.rb	(revision 41480)
@@ -4,7 +4,9 @@ https://github.com/ruby/ruby/blob/trunk/benchmark/bm_so_binary_trees.rb#L4
 # contributed by Jesse Millikan
 
 # disable output
-def STDOUT.write_ *args
+alias puts_orig puts
+def puts str
+  # disable puts
 end
 
 def item_check(tree)
@@ -25,7 +27,7 @@ def bottom_up_tree(item, depth) https://github.com/ruby/ruby/blob/trunk/benchmark/bm_so_binary_trees.rb#L27
  end
 end
 
-max_depth = 12 # 16 # ARGV[0].to_i
+max_depth = 16 # ARGV[0].to_i
 min_depth = 4
 
 max_depth = min_depth + 2 if min_depth + 2 > max_depth
@@ -55,3 +57,6 @@ min_depth.step(max_depth + 1, 2) do |dep https://github.com/ruby/ruby/blob/trunk/benchmark/bm_so_binary_trees.rb#L57
 end
 
 puts "long lived tree of depth #{max_depth}\t check: #{item_check(long_lived_tree)}"
+
+undef puts
+alias puts puts_orig

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]