guile-devel
[Top][All Lists]
Advanced

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

tracing and profiling at the repl


From: Andy Wingo
Subject: tracing and profiling at the repl
Date: Mon, 21 Dec 2009 23:18:13 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux)

Hello,

    address@hidden:~/src/guile$ meta/guile
    Guile Scheme interpreter 0.5 on Guile 1.9.6
    Copyright (C) 2001-2008 Free Software Foundation, Inc.

    Enter `,help' for help.
    scheme@(guile-user)> (define (fibo x)
    ...   (if (or (= x 1) (= x 2))
    ...       1
    ...       (+ (fibo (- x 1))
    ...  (fibo (- x 2)))))
    scheme@(guile-user)> ,tr (fibo 5)
     #<program 8c74200 at system/vm/trace.scm:30:6 ()>
    * #<program 8c74240 at <unknown port>:0:1 ()>
    * fibo 5
    ** fibo 4
    *** fibo 3
    **** fibo 2
    **** fibo 1
    *** fibo 2
    ** fibo 3
    *** fibo 2
    *** fibo 1
     #<program 8c741e0 at system/vm/trace.scm:31:6 ()>
     vm-trace-off! #<vm 8904680>

Sweet, no? We don't have return values here unfortunately, but that
could be arranged.

Now this too:

    scheme@(guile-user)> ,pr (fibo 30)
    %     cumulative   self             
    time   seconds     seconds      name
    100.00      0.29      0.29  fibo
      0.00      0.29      0.00  top-repl
      0.00      0.29      0.00  call-with-backtrace
      0.00      0.29      0.00  #<program 8caeb40 ()>
      0.00      0.29      0.00  #<program 8ca10e0 opts>
      0.00      0.29      0.00  start-repl
      0.00      0.29      0.00  #<program 89f3420 at ice-9/boot-9.scm:3394:10 
()>
      0.00      0.29      0.00  #<program 8ca13d0 at system/repl/repl.scm:87:9 
()>
    ---
    Sample count: 23
    Total time: 0.29 seconds (0 seconds in GC)

Unfortunately (make-stack ...) doesn't actually do anything right now,
so we see the whole continuation. Also unfortunately we don't see subrs
on the stack, like dynamic-wind. But hopefully these problems will be
fixed within a couple weeks.

Andy
-- 
http://wingolog.org/




reply via email to

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