Project

General

Profile

Bug #11581

profiler extra method calls

Added by robsdrops (Robert Pawlas) over 4 years ago. Updated 7 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]
[ruby-core:<unknown>]

Description

I was playing today with Ruby profiler and found something strange in my results. Let's take a sample code from docs:

require 'profile'

def slow_method
  5000.times do
    9999999999999999*999999999
  end
end

def fast_method
  5000.times do
    9999999999999999+999999999
  end
end

slow_method
fast_method

Results of methods calls should look like:

0.00     0.19      0.00        1     0.00   100.00  Object#slow_method
0.00     0.19      0.00        1     0.00    90.00  Object#fast_method

But my results are:

35.00     0.15      0.07     5001     0.01     0.03  Object#fast_method
10.00     0.19      0.02     5001     0.00     0.03  Object#slow_method

And it doesn't seem to be proper. Those methods are called once, not 5001 times.
On 1.9.3 everything works fine. And it doesn't look it is a intentional change. But if yes, please enlighten me.

Thanks

robsdrops

History

#1

Updated by robsdrops (Robert Pawlas) over 4 years ago

  • ruby -v set to 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]
#2

Updated by robsdrops (Robert Pawlas) over 4 years ago

  • Description updated (diff)

Updated by jeremyevans0 (Jeremy Evans) 7 months ago

  • Status changed from Open to Closed

profile was removed from the standard library a few months ago.

Also available in: Atom PDF