Some basic benchmarks

This commit is contained in:
Andy Meneely
2015-01-13 17:52:27 -05:00
parent cbac56f25d
commit 0dfac2970b
7 changed files with 129 additions and 1 deletions
+14
View File
@@ -1,6 +1,8 @@
require 'squib'
require 'bundler/gem_tasks'
require 'rspec/core/rake_task'
require 'yard'
require 'benchmark'
task default: [:install, :spec]
@@ -10,3 +12,15 @@ YARD::Rake::YardocTask.new(:doc) do |t|
t.files = ['lib/**/*.rb', 'samples/**/*.rb'] # optional
#t.options = ['--any', '--extra', '--opts'] # optional
end
task benchmark: [:install] do
Squib::logger.level = Logger::ERROR #silence warnings
Dir.chdir('benchmarks') do
Benchmark.bm(15) do |bm|
Dir['*.rb'].each do | script |
GC.start
bm.report(script) { load script }
end
end
end
end