diff options
5 files changed, 9 insertions, 20 deletions
diff --git a/activesupport/lib/active_support/testing/performance/jruby.rb b/activesupport/lib/active_support/testing/performance/jruby.rb index 6993db1a3b..9beadba310 100644 --- a/activesupport/lib/active_support/testing/performance/jruby.rb +++ b/activesupport/lib/active_support/testing/performance/jruby.rb @@ -16,9 +16,7 @@ module ActiveSupport protected def run_gc ManagementFactory.memory_mx_bean.gc - end - - class Performer; end + end class Profiler < Performer def initialize(*args) @@ -33,9 +31,6 @@ module ActiveSupport full_profile_options[:runs].to_i.times { run_test(@metric, :profile) } end - profile_printer = JRuby::Profiler::GraphProfilePrinter.new(@data) - profile_printer.printProfile(STDOUT) - @total = @data.getDuration / 1000 / 1000 / 1000.0 # seconds end diff --git a/activesupport/lib/active_support/testing/performance/rubinius.rb b/activesupport/lib/active_support/testing/performance/rubinius.rb index b2e77b3ce9..fafa782e8d 100644 --- a/activesupport/lib/active_support/testing/performance/rubinius.rb +++ b/activesupport/lib/active_support/testing/performance/rubinius.rb @@ -84,19 +84,19 @@ module ActiveSupport end end - class Memory < DigitalInformationUnit + class Memory < DigitalInformationUnit def measure loopback.get("system.memory.counter.bytes").last end end - class Objects < Amount + class Objects < Amount def measure loopback.get("system.memory.counter.objects").last end end - class GcRuns < Amount + class GcRuns < Amount def measure loopback.get("system.gc.full.count").last + loopback.get("system.gc.young.count").last end diff --git a/activesupport/lib/active_support/testing/performance/ruby.rb b/activesupport/lib/active_support/testing/performance/ruby.rb index e887af1979..0d40dcd22a 100644 --- a/activesupport/lib/active_support/testing/performance/ruby.rb +++ b/activesupport/lib/active_support/testing/performance/ruby.rb @@ -21,8 +21,6 @@ module ActiveSupport def run_gc GC.start end - - class Performer; end class Profiler < Performer def initialize(*args) @@ -128,28 +126,28 @@ module ActiveSupport Mode = RubyProf::MEMORY if RubyProf.const_defined?(:MEMORY) # overridden by each implementation - def measure; 0; end + def measure; end end class Objects < Amount Mode = RubyProf::ALLOCATIONS if RubyProf.const_defined?(:ALLOCATIONS) # overridden by each implementation - def measure; 0; end + def measure; end end class GcRuns < Amount Mode = RubyProf::GC_RUNS if RubyProf.const_defined?(:GC_RUNS) # overridden by each implementation - def measure; 0; end + def measure; end end class GcTime < Time Mode = RubyProf::GC_TIME if RubyProf.const_defined?(:GC_TIME) # overridden by each implementation - def measure; 0; end + def measure; end end end end diff --git a/activesupport/lib/active_support/testing/performance/ruby/mri.rb b/activesupport/lib/active_support/testing/performance/ruby/mri.rb index 22c31927f0..86e650050b 100644 --- a/activesupport/lib/active_support/testing/performance/ruby/mri.rb +++ b/activesupport/lib/active_support/testing/performance/ruby/mri.rb @@ -24,8 +24,6 @@ module ActiveSupport end end end - - class Amount < Base; end class Objects < Amount # Ruby 1.8 + ruby-prof wrapper diff --git a/railties/guides/source/performance_testing.textile b/railties/guides/source/performance_testing.textile index ca11fbeec6..a515226b9a 100644 --- a/railties/guides/source/performance_testing.textile +++ b/railties/guides/source/performance_testing.textile @@ -223,7 +223,7 @@ h6. Profiling |_.Rubinius | yes | no | no | no | no | no | no | no | |_.JRuby | yes | no | no | no | no | no | no | no | -WARNING: Profiling under JRuby is currently unavailable because of a bug with rake and JRuby's +--profile.api+ option. You should resort exclusively to benchmarking. +NOTE: To profile under JRuby you'll need to run +export JRUBY_OPTS="-Xlaunch.inproc=false --profile.api"+ *before* the performance tests. h4. Understanding the Output @@ -309,8 +309,6 @@ h6. Output Availability |_.Rubinius | yes | yes | no | |_.JRuby | yes | yes | no | -WARNING: Again, profiling under JRuby is currently unavailable because of a bug with rake and JRuby's +--profile.api+ option. - h4. Tuning Test Runs Test runs can be tuned by setting the +profile_options+ class variable on your test class. |