guile-user
[Top][All Lists]
Advanced

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

A problem with statprof


From: Tommi Höynälänmaa
Subject: A problem with statprof
Date: Wed, 17 Apr 2019 11:52:18 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0


It seems that statprof gives some second counts in some other units
than seconds. I'm using guile 2.9.1. Consider the following program:

---cut here---
(import (statprof))

(define (factorial n)
  (if (= n 0) 1 (* n (factorial (- n 1)))))

(define (main args)
  (statprof-reset 0 50000 #t)
  (statprof-start)
  (display "Hello\n")
  (display (factorial 100000))
  (newline)
  (statprof-stop)
  (statprof-display))
---cut here---

This program gives the following output:
---cut here---
...
%     cumulative   self
time   seconds    seconds   calls   procedure
 57.14      1.83      1.83                            anon #x55f314c21e40
 41.07 111105.81      1.32 /home/tohoyn/tyo/omat/ohj/scheme/muut/statprof-test2.scm:4:0:factorial
  1.79      0.06      0.06                            anon #x55f314c27a38
  0.00      3.21      0.00 ice-9/eval.scm:618:6
  0.00      3.21      0.00 ice-9/boot-9.scm:701:0:call-with-prompt
  0.00      3.21      0.00 /home/tohoyn/tyo/omat/ohj/scheme/muut/statprof-test2.scm:7:0:main
  0.00      3.21      0.00                            anon #x55f314c29930
  0.00      1.83      0.00                            anon #x55f314c1f7e0
---
Sample count: 56
Total time: 3.206961337 seconds (1.765094628 seconds in GC)
---cut here---

Obviously the cumulative time for procedure factorial is not given in
seconds. OTOH the time for procedure main is correct. What is wrong
here?

     - Tommi Höynälänmaa





reply via email to

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