Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

overcome merge difficulty

  • Loading branch information...
commit 37543a8419123eb28ef083d2333491731f499466 2 parents db3549b + 2d8d0f2
@rdp rdp authored
View
13 README
@@ -12,12 +12,17 @@ Benchmarks are run using rake. Type "rake -T bench" to see options.
Examples:
rake bench
- rake bench:file FILE=/rbs/core-features/bm_app_tak.rb
- rake bench:dir DIR=/rbs/core-features
+ rake bench:file FILE=rbs/micro-benchmarks/bm_app_tak.rb
+ rake bench:dir DIR=rbs/micro-benchmarks
rake bench:to_csv
+ rake bench:pattern PATTERN=rbs/micro-benchmarks/bm_gc*
+ rake VM=/bin/ruby_special ITERATIONS=3 TIMEOUT=5
The :to_csv task creates a .csv spreadsheet of the results. Quite handy for comparing your results over time.
+The VM example runs '/bin/ruby_special' as the VM, 3 iterations instead of the default (5)5, 5 second timeout (per script) instead of the default 300s
+
+
DIRECTORY STRUCTURE
===================
deprecated_rbs - contains the old, deprecated version of the suite
@@ -35,4 +40,6 @@ You'll probably want to copy rakelib/bench.rake and modify some filenames and lo
If you want to run a different implementation set the environment variable VM to point to a ruby executable or change this line in rakelib/bench.rake:
VM = ENV['VM'] || "ruby"
-The current version relies on a bash script and as such it requires Cygwin to work on Windows. We are working to eliminate this requirement.
+GROUP
+=====
+There is a mailing list at http://groups.google.com/group/ruby-benchmark-suite
View
18 Rakefile
@@ -1,21 +1,5 @@
# This Rakefile is included so you can run RBS Benchmarks
-#
-# rake bench # Run all the RBS benchmarks
-# rake bench:dir # Run all the RBS benchmarks in DIR
-# ex: rake bench:dir DIR=rbs/macro-benchmarks
-# rake bench:file # Run only the RBS benchmark specified by FILE
-# ex: rake bench:file FILE=rbs/macro-benchmarks/rails/bm_substruct_one_tenth_startup.rb
-# rake bench:results # Plot the RBS benchmark results (not implemented)
-# rake bench:to_csv # Generate a CSV file of RBS results
-#
-# NOTE: rakelib/bench.rake requires this directory to be named: benchmark
-# you may want to modify bench.rake to suit your own defaults.
-# If you want to run a different implementation set the environment
-# variable VM to point to a ruby executable, or change this line in
-# rakelib/bench.rake
-# VM = ENV['VM'] || "ruby"
-#
-# other useful environment variables: ITERATIONS (default 5), TIMEOUT (300)
+# See the readme for examples
task :default => :'bench'
View
19 rakelib/bench.rake
@@ -26,7 +26,7 @@ end
# Cache the name so it is only generated once during an invocation.
# Eliminates having to save the name and pass it around.
def report
- # os = `uname`.chomp
+ # os = `uname`.chomp # doesn't work on doze
# host = `uname -n`.chomp
vm = File.basename VM.split.first
# @report ||= "#{RBS_RESULTS_DIR}/RBS-#{vm}-#{os}-#{host}-#{Time.now.strftime "%y%m%d.%H%M%S"}.yaml"
@@ -119,6 +119,23 @@ namespace :bench do
puts "Done"
end
+ desc "Run all the RBS benchmarks that match PATTERN ex: PATTERN=rbs/micro-benchmarks/bm_gc*"
+ task :pattern => :setup do
+ dir = ENV['PATTERN'] || raise("bench:pattern needs PATTERN set")
+
+ puts "Running all benchmarks matching #{dir}"
+ puts " Writing report to #{report_name}"
+
+ Dir[dir].sort.each do |name|
+ Dir.chdir File.dirname(name) do
+ puts " Running #{File.basename name}"
+ system "#{command name}"
+ end
+ end
+
+ puts "Done"
+ end
+
desc "Run all the RBS benchmarks in DIR"
task :dir => :setup do
dir = ENV['DIR'] || raise("bench:dir needs DIR to be a directory")
View
7 rbs/micro-benchmarks/bm_gc_cow.rb
@@ -1,7 +0,0 @@
-GC.copy_on_write_friendly=true if GC.respond_to? :copy_on_write_friendly=
-
-Bench.run [500_000, 1_000_000, 3_000_000] do |n|
- a = []
- n.times { a << []} # use up some RAM
- n.times {[]}
-end
View
14 utils/bench.rb
@@ -8,9 +8,9 @@
# # do something interesting
# end
#
-# Bench.run { quirks 100 }
+# Bench.run [100] { |n| quirks n }
#
-# Bench.run will time the running of the block for the requested
+# Bench.run will run the blocktime the running of the block for the requested
# number of iterations and then compute some statistics and append
# a YAML-formatted report to the specified file.
@@ -80,6 +80,16 @@ def write_parameters(inputs)
inputs.each do |input|
f.puts "- #{input}"
end
+
+ begin
+ version_string = ""
+ version_string = "#{RUBY_VERSION} #{RUBY_RELEASE_DATE} #{RUBY_PATCHLEVEL} #{RUBY_PLATFORM}"
+ require 'rbconfig'
+ version_string += ';' + Config::CONFIG['CFLAGS'] + ';' + Config::CONFIG["configure_args"]
+ rescue Exception
+ end
+
+ f.puts "ruby_ver: " + version_string
end
end
View
4 utils/monitor.rb
@@ -4,14 +4,16 @@
timeout = File.dirname(__FILE__) + "/timeout"
+null = "/dev/null"
if RUBY_PLATFORM =~ /mingw|mswin/
timeout = "ruby " + File.dirname(__FILE__) + "/timeout2.rb"
+ null = "NUL"
end
limit, vm, runner, name, iterations, report = ARGV
start = Time.now
-cmd = "#{timeout} -t #{limit} #{vm} #{runner} #{name} #{iterations} #{report} > /dev/null"
+cmd = "#{timeout} -t #{limit} #{vm} #{runner} #{name} #{iterations} #{report} > #{null}"
system cmd
finish = Time.now

0 comments on commit 37543a8

Please sign in to comment.
Something went wrong with that request. Please try again.