ruby-changes:29438
From: ko1 <ko1@a...>
Date: Thu, 20 Jun 2013 18:32:07 +0900 (JST)
Subject: [ruby-changes:29438] ko1:r41490 (trunk): * benchmark/gc/gcbench.rb: Do not use GC::Profiler::disable because
ko1 2013-06-20 18:31:51 +0900 (Thu, 20 Jun 2013) New Revision: 41490 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=41490 Log: * benchmark/gc/gcbench.rb: Do not use GC::Profiler::disable because GC::Profiler::disable prohibit to access profiling data. It should be spec bug. Skip GC::Profiler::report if RUBY_VERSION < '2.0.0' Modified files: trunk/ChangeLog trunk/benchmark/gc/gcbench.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 41489) +++ ChangeLog (revision 41490) @@ -1,3 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Thu Jun 20 18:29:26 2013 Koichi Sasada <ko1@a...> + + * benchmark/gc/gcbench.rb: Do not use GC::Profiler::disable because + GC::Profiler::disable prohibit to access profiling data. It should + be spec bug. + + Skip GC::Profiler::report if RUBY_VERSION < '2.0.0' + Thu Jun 20 17:59:08 2013 Koichi Sasada <ko1@a...> * benchmark/gc/gcbench.rb: stop GC::Profiler before output results. Index: benchmark/gc/gcbench.rb =================================================================== --- benchmark/gc/gcbench.rb (revision 41489) +++ benchmark/gc/gcbench.rb (revision 41490) @@ -12,12 +12,11 @@ GC::Profiler.enable https://github.com/ruby/ruby/blob/trunk/benchmark/gc/gcbench.rb#L12 tms = Benchmark.measure{|x| load script } +gc_time = GC::Profiler.total_time +GC::Profiler.report if RUBY_VERSION >= '2.0.0' # before 1.9.3, report() may run infinite loop GC::Profiler.disable -GC::Profiler.report pp GC.stat -gc_time = GC::Profiler.total_time - puts puts script puts Benchmark::CAPTION -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/