Some basic benchmarks
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user