[Larceny-users] GC options
Felix Klock
felixluser at pnkfx.org
Fri Jan 26 20:23:22 EST 2007
Sven-
On Jan 26, 2007, at 6:45 PM, Sven.Hartrumpf at FernUni-Hagen.de wrote:
> I see no runtime difference. Just to be sure:
> I produce the heap in this way:
>> echo "(require 'srfi-0) (require 'srfi-2) (require 'srfi-8)
>> (require 'srfi-9) (load \"nallla.fasl\") (display-memstats
>> (memstats))" | memtime larceny -load 4 -size1 16M -size2 32M -
>> size3 512M -reorganize-and-dump
> I run it like this:
>> echo "(require 'srfi-0) (require 'srfi-2) (require 'srfi-8)
>> (require 'srfi-9) (load \"nallla.fasl\") (display-memstats
>> (memstats))" | memtime larceny -load 4 -size1 16M -size2 32M -
>> size3 512M -heap larceny.heap.split -- -q 0
>
> Is this correct?
Those steps above are not going to do the job, because when you pass
larceny the -reorganize-and-dump option, it does not bring up a REPL;
it just loads the heap (which will be the default larceny.heap in
your case) and makes a split version of it, which means that the
expressions you are piping to larceny in your first command are just
being discarded. The larceny.heap is already split, so I think your
first command above just makes a copy of the larceny.heap named
larceny.heap.split.
You need an extra step in there where you dump an intermediate heap
with your code in it from a running larceny (using the dump-
interacitve-heap procedure). Using the dump-interactive-heap
procedure requires running larceny with the -stopcopy option (because
we do not support heap dumping with the generational collectors).
Here is an example usage:
% larceny -stopcopy
Larceny v0.93 "Deviated Prevert" (Nov 10 2006 04:28:22,
precise:Linux:unified)
> (define (fib n) (case n ((0 1) 1) (else (+ (fib (- n 1)) (fib (- n
2))))))
fib
> (dump-interactive-heap "fib.heap")
; Dumping heap...
; Done.
> (exit)
% larceny -heap fib.heap
Larceny v0.93 "Deviated Prevert" (Nov 10 2006 04:28:22,
precise:Linux:unified)
> (time (fib 35))
Words allocated: 0
Words reclaimed: 0
Elapsed time...: 506 ms (User: 504 ms; System: 0 ms)
Elapsed GC time: 0 ms (CPU: 0 in 0 collections.)
14930352
> (exit)
% larceny -heap fib.heap -reorganize-and-dump
Larceny v0.93 "Deviated Prevert" (Nov 10 2006 04:28:22,
precise:Linux:unified)
Reorganizing.
Data: 1519616 bytes, Text: 3076096 bytes
Dumping "fib.heap.split".
% larceny -heap fib.heap.split
Larceny v0.93 "Deviated Prevert" (Nov 10 2006 04:28:22,
precise:Linux:unified)
> (time (fib 35))
Words allocated: 0
Words reclaimed: 0
Elapsed time...: 518 ms (User: 520 ms; System: 0 ms)
Elapsed GC time: 0 ms (CPU: 0 in 0 collections.)
14930352
> (exit)
%
Note that in this case using -reorganize-and-dump didn't improve
anything. But even just using a dumped heap (rather than loading
from source) may improve performance for your application.
-Felix
More information about the Larceny-users
mailing list