Project

General

Profile

Actions

Bug #161

closed

Profile library seems broken in 1.9 15427cat t.rv

Added by pragdave (Dave Thomas) over 14 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Normal
Target version:
-
ruby -v:
Backport:
[ruby-core:17261]

Description

=begin
dave[RUBY3/Book 18:11:11*] cat t.rb
require 'profile'
def ackerman(m, n)
if m == 0 then n+1
elsif n == 0 and m > 0 then ackerman(m-1, 1)
else ackerman(m-1, ackerman(m, n-1))
end
end
ackerman(3, 3)

With 1.8:

dave[RUBY3/Book 18:11:36*] /usr/bin/ruby -v t.rb
ruby 1.8.6 (2007-09-24 patchlevel 111) [universal-darwin9.0]
% cumulative self self total
time seconds seconds calls ms/call ms/call name
72.97 0.27 0.27 2432 0.11 4.65 Object#ackerman
13.51 0.32 0.05 3676 0.01 0.01 Fixnum#==
10.81 0.36 0.04 2431 0.02 0.02 Fixnum#-
2.70 0.37 0.01 1188 0.01 0.01 Fixnum#+
0.00 0.37 0.00 1 0.00 0.00 Module#method_added
0.00 0.37 0.00 57 0.00 0.00 Fixnum#>
0.00 0.37 0.00 1 0.00 370.00 #toplevel

With 1.9:

dave[RUBY3/Book 18:11:40*] ruby -v t.rb
ruby 1.9.0 (2008-06-16 revision 15427) [i686-darwin9.3.0]
% cumulative self self total
time seconds seconds calls ms/call ms/call name
0.00 0.00 0.00 1 0.00 0.00 Module#method_added
0.00 0.01 0.00 1 0.00 10.00 #toplevel
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0