ruby-changes:41988
From: ko1 <ko1@a...>
Date: Wed, 9 Mar 2016 16:42:37 +0900 (JST)
Subject: [ruby-changes:41988] ko1:r54062 (trunk): * benchmark/driver.rb: fix output messages.
ko1 2016-03-09 16:42:32 +0900 (Wed, 09 Mar 2016) New Revision: 54062 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=54062 Log: * benchmark/driver.rb: fix output messages. * benchmark/memory_wrapper.rb: use respond_to? because member? does not work well. Modified files: trunk/ChangeLog trunk/benchmark/driver.rb trunk/benchmark/memory_wrapper.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 54061) +++ ChangeLog (revision 54062) @@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Wed Mar 9 16:41:44 2016 Koichi Sasada <ko1@a...> + + * benchmark/driver.rb: fix output messages. + + * benchmark/memory_wrapper.rb: use respond_to? because + member? does not work well. + Wed Mar 9 16:20:25 2016 Koichi Sasada <ko1@a...> * benchmark/driver.rb: support memory usage benchmark. Index: benchmark/driver.rb =================================================================== --- benchmark/driver.rb (revision 54061) +++ benchmark/driver.rb (revision 54062) @@ -219,9 +219,9 @@ class BenchmarkDriver https://github.com/ruby/ruby/blob/trunk/benchmark/driver.rb#L219 if @execs.size > 1 output output({ - rss: "Memory consuming ratio (RSS) with the result of `#{@execs[0][1]}' (greater is worse)", - peak: "Memory consuming ratio (peak) with the result of `#{@execs[0][1]}' (greater is worse)", - size: "Memory consuming ratio (size) with the result of `#{@execs[0][1]}' (greater is worse)", + real: "Speedup ratio: compare with the result of `#{@execs[0][1]}' (greater is better)" + peak: "Memory consuming ratio (peak) with the result of `#{@execs[0][1]}' (greater is better)", + size: "Memory consuming ratio (size) with the result of `#{@execs[0][1]}' (greater is better)", }[@measure_target]) output if markdown output ["name".ljust(name_width), @execs[1..-1].map.with_index{|(_, v), i| sprintf(strformat, v, width[i])}].join("").rstrip Index: benchmark/memory_wrapper.rb =================================================================== --- benchmark/memory_wrapper.rb (revision 54061) +++ benchmark/memory_wrapper.rb (revision 54062) @@ -7,9 +7,9 @@ open(write_file, 'wb'){|f| https://github.com/ruby/ruby/blob/trunk/benchmark/memory_wrapper.rb#L7 ms = Memory::Status.new case target.to_sym when :peak - key = ms.member?(:hwm) ? :hwm : :peak + key = ms.respond_to?(:hwm) ? :hwm : :peak when :size - key = ms.member?(:rss) ? :rss : :size + key = ms.respond_to?(:rss) ? :rss : :size end f.puts ms[key] -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/