summaryrefslogtreecommitdiff
path: root/ruby_2_2/benchmark/gc/gcbench.rb
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-14 15:59:18 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-14 15:59:18 +0000
commit72113d58cd2fc62b3f4ef3d2eb6cec37393532a4 (patch)
tree534843caaea28f1171378c1ac5bea0184ed04054 /ruby_2_2/benchmark/gc/gcbench.rb
parent1a74fa4b04da04bd2bb33103dd3cf431438df38e (diff)
parent02b8978ff10b05304dbb46d73b49a2cf3a87cb92 (diff)
add tag v2_2_9v2_2_9
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v2_2_9@61259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby_2_2/benchmark/gc/gcbench.rb')
-rw-r--r--ruby_2_2/benchmark/gc/gcbench.rb56
1 files changed, 0 insertions, 56 deletions
diff --git a/ruby_2_2/benchmark/gc/gcbench.rb b/ruby_2_2/benchmark/gc/gcbench.rb
deleted file mode 100644
index 09a404466a..0000000000
--- a/ruby_2_2/benchmark/gc/gcbench.rb
+++ /dev/null
@@ -1,56 +0,0 @@
-require 'benchmark'
-require 'pp'
-require 'optparse'
-
-$list = true
-$gcprof = true
-
-opt = OptionParser.new
-opt.on('-q'){$list = false}
-opt.on('-d'){$gcprof = false}
-opt.parse!(ARGV)
-
-script = File.join(File.dirname(__FILE__), ARGV.shift)
-script += '.rb' unless FileTest.exist?(script)
-raise "#{script} not found" unless FileTest.exist?(script)
-
-puts "Script: #{script}"
-
-if $gcprof
- GC::Profiler.enable
-end
-
-tms = Benchmark.measure{|x|
- load script
-}
-
-gc_time = 0
-
-if $gcprof
- gc_time = GC::Profiler.total_time
- GC::Profiler.report if $list and RUBY_VERSION >= '2.0.0' # before 1.9.3, report() may run infinite loop
- GC::Profiler.disable
-end
-
-pp GC.stat
-
-puts "#{RUBY_DESCRIPTION} #{GC::OPTS.inspect}" if defined?(GC::OPTS)
-
-desc = "#{RUBY_VERSION}#{RUBY_PATCHLEVEL >= 0 ? "p#{RUBY_PATCHLEVEL}" : "dev"}"
-name = File.basename(script, '.rb')
-
-puts
-puts script
-puts Benchmark::CAPTION
-puts tms
-puts "GC total time (sec): #{gc_time}"
-
-# show High-Water Mark on Linux
-if File.exist?('/proc/self/status') && /VmHWM:\s*(\d+.+)/ =~ File.read('/proc/self/status')
- puts
- puts "VmHWM: #{$1.chomp}"
-end
-
-puts
-puts "Summary of #{name} on #{desc}\t#{tms.real}\t#{gc_time}\t#{GC.count}"
-puts " (real time in sec, GC time in sec, GC count)"