Skip to content
Browse files

added information about what is being used

  • Loading branch information...
1 parent b169d83 commit c8019cd04a180c663dc15e2686a62bba545f8cd9 @goncalossilva goncalossilva committed with wycats Jun 12, 2010
Showing with 6 additions and 2 deletions.
  1. +6 −2 activesupport/lib/active_support/testing/performance.rb
View
8 activesupport/lib/active_support/testing/performance.rb
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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

0 comments on commit c8019cd

Please sign in to comment.
Something went wrong with that request. Please try again.