Sha256: 1b23283bdd4fbb7b39c9ae5bff3e591ca054bc3aa01fcfff4e389b192f08fdcb
Contents?: true
Size: 714 Bytes
Versions: 50
Compression:
Stored size: 714 Bytes
Contents
#$:.unshift(File.join(File.dirname(__FILE__), "..", "lib")) #require 'jruby-prof' def empty_method end #puts "method overhead" # TIMES = 1000 # #s = Time.now #0.upto(TIMES) { empty_method } #puts "#{TIMES} empty method calls took #{Time.now - s}s without tracing" # #JRubyProf.start #s = Time.now #0.upto(TIMES) { empty_method } #JRubyProf.stop #puts "#{TIMES} empty method calls took #{Time.now - s}s with tracing" def fib(n) a, b = 0, 1 n.times { a, b = b, a + b } b end def test_fib 0.upto(TIMES) { fib(5000) } end test_fib s = Time.now test_fib puts "fib took #{Time.now - s}s without tracing" JRubyProf.start s = Time.now test_fib JRubyProf.stop puts "fib took #{Time.now - s}s with tracing"
Version data entries
50 entries across 50 versions & 2 rubygems