chicken-janitors
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-janitors] #634: Profiler does not work correctly on recursive p


From: Chicken Trac
Subject: [Chicken-janitors] #634: Profiler does not work correctly on recursive procedures
Date: Tue, 05 Jul 2011 10:15:08 -0000

#634: Profiler does not work correctly on recursive procedures
----------------------+-----------------------------------------------------
 Reporter:  megane    |       Owner:       
     Type:  defect    |      Status:  new  
 Priority:  minor     |   Milestone:       
Component:  compiler  |     Version:  4.7.x
 Keywords:  profiler  |  
----------------------+-----------------------------------------------------
 The profiler seems to calculate the time spent on recursive funtion calls
 incorrectly.

 Here is a simple example program:
 {{{
 (define (fib n)
     (if (or (equal? n 0) (equal? n 1))
         n
         (+ (fib (- n 1)) (fib ( - n 2)))))

 (define (main)
   (let loop [(i 100)]
     (if (> i 0)
         (begin
           (fib 15)
           (loop (sub1 i))))))

 (main)
 }}}
 And here is a sample output from chicken-profiler:
 {{{
 procedure   calls  seconds  average  percent
 --------------------------------------------
 fib        197300    4.695    0.000  100.000
 main            1    0.092    0.092    1.959
 }}}

-- 
Ticket URL: <http://bugs.call-cc.org/ticket/634>
Chicken Scheme <http://www.call-with-current-continuation.org/>
Chicken Scheme is a compiler for the Scheme programming language.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]