[Larceny-users] profiling spirales

Eduardo Cavazos wayo.cavazos at gmail.com
Sat Feb 14 16:07:48 EST 2009


Eduardo Cavazos wrote:

>> I'm interested in finding out where *my* code is spending all it's time.
>> :-) Is there a profiler for Larceny?

William D Clinger wrote:

> Yes, but it has very crude resolution.  In R5RS mode:

Thank you! This is a big help.

My suspicions have been confirmed. :-)

So what do the numbers mean? There are two tables which are output each 
time.

Below are the results of running the profiler on some of my code 4 
times. 'hsva' is pretty consistently low in the first table while high 
in the second. 'get-modelview-matrix' is middle to high in both tables.

If anybody is curious to see the code being profiled, it's here:

     http://proteus.freeshell.org/_profiling-spirales-a.scm

I normally use macros and a nice framework for running cfdg models. The 
above is a manual expansion of the macro. Also, the work is actually 
done in a procedure which is registered with OpenGL as a callback. So 
instead of registering it, I run it explicitly and profile it.

Ed

----------------------------------------------------------------------
  %  topmost named procedure
28  run-with-profiling
9  \x1;get-modelview-matrix
8  \x1;double-vector
7  map
7  big-multiply-through-by
5  \x1;gl-flip
5  ffi/apply
4  list->vector
4  \x1;->
4  number-type
2  big*-
2  flonum-check
2  div-and-mod
2  big-divide-digits
2  fixnum->bignum
2  %flonum->bignum
2  big-limited-normalize!
2  expt
1  \x1;hsva
1  dynamic-wind
1  syscall
1  %bignum-length
1  bignum-alloc

  %  active procedures
100  r5rs-entry-point
100  repl
100  run-with-profiling
22  \x1;hsva
20  %flonum->integer
20  %flonum->bignum
19  \x1;gl-flip
13  \x1;double-vector
13  bignum-quotient
13  big-divide-digits
11  \x1;get-modelview-matrix
8  map
7  big*-
7  big-multiply-through-by
5  ffi/apply
4  \x1;vec
4  list->vector
4  \x1;->
4  number-type
3  div-and-mod
3  fixnum->bignum
3  expt
2  flonum-check
2  big-limited-normalize!
1  dynamic-wind
1  \x1;gl-color
1  syscall
1  %bignum-length
1  bignum-alloc
----------------------------------------------------------------------
  %  topmost named procedure
37  run-with-profiling
9  map
7  big-multiply-through-by
6  \x1;->
5  ffi/apply
5  \x1;double-vector
4  \x1;get-modelview-matrix
4  flonum-check
4  big-divide-digits
3  dynamic-wind
2  \x1;gl-flip
2  big*-
2  list->vector
2  number-type
2  expt
2  \x1;hsva
1  bignum-quotient
1  big-normalize!
1  %bignum-length
1  div-and-mod
1  big-limited-normalize!
1  syscall
1  bignum->fixnum

  %  active procedures
100  r5rs-entry-point
100  repl
100  run-with-profiling
21  \x1;hsva
19  %flonum->integer
19  %flonum->bignum
15  bignum-quotient
14  big-divide-digits
10  \x1;gl-flip
10  map
8  \x1;double-vector
7  \x1;get-modelview-matrix
7  big-multiply-through-by
6  \x1;->
5  ffi/apply
4  flonum-check
3  big*-
3  dynamic-wind
2  \x1;vec
2  list->vector
2  number-type
2  expt
1  big-normalize!
1  bignum-zero?
1  %bignum-length
1  div-and-mod
1  big-limited-normalize!
1  syscall
1  bignum->fixnum
----------------------------------------------------------------------
  %  topmost named procedure
26  run-with-profiling
9  map
7  \x1;get-modelview-matrix
7  ffi/apply
6  \x1;->
6  big-multiply-through-by
5  \x1;double-vector
5  \x1;gl-flip
4  big-divide-digits
3  flonum-check
3  list->vector
3  number-type
2  big*-
2  div-and-mod
2  fixnum->bignum
2  %bignum-length
2  big-limited-normalize!
2  expt
1  bignum-quotient
1  big-normalize!
1  \x1;hsva
1  syscall
1  bignum->fixnum
1  %flonum->bignum
1  bignum-alloc

  %  active procedures
100  r5rs-entry-point
100  repl
100  run-with-profiling
25  \x1;hsva
24  %flonum->integer
24  %flonum->bignum
16  bignum-quotient
15  big-divide-digits
14  \x1;gl-flip
12  map
9  \x1;get-modelview-matrix
8  \x1;double-vector
7  ffi/apply
6  \x1;->
6  big-multiply-through-by
5  big*-
3  flonum-check
3  \x1;vec
3  list->vector
3  number-type
3  fixnum->bignum
3  expt
2  div-and-mod
2  %bignum-length
2  big-limited-normalize!
1  big-normalize!
1  bignum-zero?
1  \x1;gl-color
1  syscall
1  bignum->fixnum
1  bignum-alloc
----------------------------------------------------------------------
  %  topmost named procedure
32  run-with-profiling
8  map
7  \x1;double-vector
7  \x1;get-modelview-matrix
6  ffi/apply
6  big-multiply-through-by
5  \x1;gl-flip
4  dynamic-wind
3  number-type
3  list->vector
3  \x1;->
3  fixnum->bignum
3  big-divide-digits
2  big*-
2  %flonum->bignum
2  div-and-mod
1  collect-arguments
1  expt
1  big-limited-normalize!
1  syscall
1  flonum-check

  %  active procedures
100  r5rs-entry-point
100  repl
100  run-with-profiling
18  \x1;hsva
17  %flonum->integer
17  %flonum->bignum
17  \x1;gl-flip
12  bignum-quotient
12  big-divide-digits
11  \x1;double-vector
11  \x1;get-modelview-matrix
8  map
6  ffi/apply
6  big-multiply-through-by
5  big*-
4  dynamic-wind
3  number-type
3  div-and-mod
3  \x1;vec
3  list->vector
3  \x1;->
3  fixnum->bignum
2  \x1;gl-color
1  collect-arguments
1  expt
1  big-limited-normalize!
1  syscall
1  flonum-check
----------------------------------------------------------------------



More information about the Larceny-users mailing list