From bd441bb06653c1696ccdce486add6e2d0b8e93d3 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 18 Apr 2005 19:03:25 +0000 Subject: Updated to take compilation out of the measurements git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1214 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- railties/bin/benchmarker | 3 +++ railties/bin/profiler | 3 +++ 2 files changed, 6 insertions(+) (limited to 'railties') diff --git a/railties/bin/benchmarker b/railties/bin/benchmarker index a5814d98a6..b07ddcfcb2 100644 --- a/railties/bin/benchmarker +++ b/railties/bin/benchmarker @@ -9,6 +9,9 @@ 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) } } diff --git a/railties/bin/profiler b/railties/bin/profiler index aca84055c2..f0f14a2b99 100644 --- a/railties/bin/profiler +++ b/railties/bin/profiler @@ -8,6 +8,9 @@ end require File.dirname(__FILE__) + '/../config/environment' require "profiler" +# Don't include compilation in the profile +eval(ARGV.first) + Profiler__::start_profile (ARGV[1] || 1).to_i.times { eval(ARGV.first) } Profiler__::stop_profile -- cgit v1.2.3