mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-23 07:34:08 +01:00
And here's the copy step.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@501 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
parent
c34d9faa38
commit
06f14dd3b9
1721 changed files with 200174 additions and 0 deletions
19
tracks/script/benchmarker
Executable file
19
tracks/script/benchmarker
Executable file
|
|
@ -0,0 +1,19 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
if ARGV.empty?
|
||||
puts "Usage: benchmarker times 'Person.expensive_way' 'Person.another_expensive_way' ..."
|
||||
exit
|
||||
end
|
||||
|
||||
require File.dirname(__FILE__) + '/../config/environment'
|
||||
require 'benchmark'
|
||||
include Benchmark
|
||||
|
||||
# Don't include compilation in the benchmark
|
||||
ARGV[1..-1].each { |expression| eval(expression) }
|
||||
|
||||
bm(6) do |x|
|
||||
ARGV[1..-1].each_with_index do |expression, idx|
|
||||
x.report("##{idx + 1}") { ARGV[0].to_i.times { eval(expression) } }
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue