Skip to content

Commit

Permalink
process time for benchmarks (quicker), wall time for profiling (lower…
Browse files Browse the repository at this point in the history
… overhead)
  • Loading branch information
jeremy committed Jun 16, 2008
1 parent e433bb1 commit 899d63b
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions activesupport/lib/active_support/testing/performance.rb
Expand Up @@ -8,16 +8,20 @@
module ActiveSupport
module Testing
module Performance
benchmark = ARGV.include?('--benchmark') # HAX for rake test

DEFAULTS = {
:benchmark => benchmark,
:runs => benchmark ? 10 : 1,
:min_percent => 0.02,
:metrics => [:process_time, :wall_time, :cpu_time, :memory, :objects],
:formats => [:flat, :graph_html, :call_tree],
:output => 'tmp/performance'
}
DEFAULTS =
if benchmark = ARGV.include?('--benchmark') # HAX for rake test
{ :benchmark => true,
:runs => 10,
:metrics => [:process_time, :memory, :objects],
:output => 'tmp/performance' }
else
{ :benchmark => false,
:runs => 1,
:min_percent => 0.02,
:metrics => [:wall_time, :memory, :objects],
:formats => [:flat, :graph_html, :call_tree],
:output => 'tmp/performance' }
end

def self.included(base)
base.class_inheritable_hash :profile_options
Expand Down

0 comments on commit 899d63b

Please sign in to comment.