diff options
author | Gonçalo Silva <goncalossilva@gmail.com> | 2010-06-12 12:02:55 +0100 |
---|---|---|
committer | wycats <wycats@gmail.com> | 2010-06-17 19:18:53 -0700 |
commit | c8019cd04a180c663dc15e2686a62bba545f8cd9 (patch) | |
tree | 406e9c6d8309592f50a62c2d46d67046ac366a2c /activesupport/lib/active_support/testing | |
parent | b169d8378725fc96eb904e5711e68307b0841e12 (diff) | |
download | rails-c8019cd04a180c663dc15e2686a62bba545f8cd9.tar.gz rails-c8019cd04a180c663dc15e2686a62bba545f8cd9.tar.bz2 rails-c8019cd04a180c663dc15e2686a62bba545f8cd9.zip |
added information about what is being used
Diffstat (limited to 'activesupport/lib/active_support/testing')
-rw-r--r-- | activesupport/lib/active_support/testing/performance.rb | 8 |
1 files changed, 6 insertions, 2 deletions
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 |