From c8019cd04a180c663dc15e2686a62bba545f8cd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A7alo=20Silva?= Date: Sat, 12 Jun 2010 12:02:55 +0100 Subject: added information about what is being used --- activesupport/lib/active_support/testing/performance.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'activesupport') diff --git a/activesupport/lib/active_support/testing/performance.rb b/activesupport/lib/active_support/testing/performance.rb index 9be156c45d..472b15bfe0 100644 --- a/activesupport/lib/active_support/testing/performance.rb +++ b/activesupport/lib/active_support/testing/performance.rb @@ -260,6 +260,7 @@ begin end protected + # Ruby 1.9 + extented GC profiler patch if defined?(GC::Profiler) def with_gc_stats GC.start @@ -270,6 +271,8 @@ begin GC::Profiler.disable GC.enable end + + # Ruby 1.8 + ruby-prof wrapper else def with_gc_stats yield @@ -324,7 +327,7 @@ begin 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 @@ begin 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 @@ begin count end + # Ruby 1.8 + ruby-prof wrapper elsif RubyProf.respond_to?(:measure_allocations) def measure RubyProf.measure_allocations -- cgit v1.2.3