Skip to content

Commit

Permalink
added information about what is being used
Browse files Browse the repository at this point in the history
  • Loading branch information
goncalossilva authored and wycats committed Jun 18, 2010
1 parent b169d83 commit c8019cd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions activesupport/lib/active_support/testing/performance.rb
Expand Up @@ -260,6 +260,7 @@ def profile
end

protected
# Ruby 1.9 + extented GC profiler patch
if defined?(GC::Profiler)
def with_gc_stats
GC.start
Expand All @@ -270,6 +271,8 @@ def with_gc_stats
GC::Profiler.disable
GC.enable
end

# Ruby 1.8 + ruby-prof wrapper
else
def with_gc_stats
yield
Expand Down Expand Up @@ -324,7 +327,7 @@ def measure
class Memory < Base
Mode = RubyProf::MEMORY if RubyProf.const_defined?(:MEMORY)

# Ruby 1.9 + extented GC profiler patch
# Ruby 1.9 + extended GC profiler patch
if defined?(GC::Profiler) and GC::Profiler.respond_to?(:data)
def measure
GC.enable
Expand All @@ -334,7 +337,7 @@ def measure
kb
end

# ruby-prof wrapper
# Ruby 1.8 + ruby-prof wrapper
elsif RubyProf.respond_to?(:measure_memory)
def measure
RubyProf.measure_memory / 1024.0
Expand All @@ -359,6 +362,7 @@ def measure
count
end

# Ruby 1.8 + ruby-prof wrapper
elsif RubyProf.respond_to?(:measure_allocations)
def measure
RubyProf.measure_allocations
Expand Down

0 comments on commit c8019cd

Please sign in to comment.