Discussion:
[Larceny-users] load time for SRFI 19
Eduardo Cavazos
2009-04-15 19:32:15 UTC
Permalink
~ # time echo '(import (srfi :19))' | larceny -err5rs
Larceny v0.97a4 (alpha test) (Apr 15 2009 05:42:48, precise:Linux:unified)
larceny.heap, built on Wed Apr 15 05:48:18 CDT 2009
ERR5RS mode (no libraries have been imported)
Autoloading (srfi :19)
real 0m9.517s
user 0m9.265s
sys 0m0.104s

I think 9 seconds is a little long eh? It is compiled:

~ # ls -l /src/larceny/lib/SRFI/srfi/%3a19.slfasl
-rw-r--r-- 1 root root 11206 2009-04-15 13:48
/src/larceny/lib/SRFI/srfi/%3a19.slfas

Compare with base startup time:

~ # time echo '(import (primitives exit)) (exit)' | larceny -err5rs
Larceny v0.97a4 (alpha test) (Apr 15 2009 05:42:48, precise:Linux:unified)
larceny.heap, built on Wed Apr 15 05:48:18 CDT 2009
ERR5RS mode (no libraries have been imported)
real 0m0.553s
user 0m0.472s
sys 0m0.040s
Eduardo Cavazos
2009-04-15 21:48:24 UTC
Permalink
Post by Eduardo Cavazos
~ # time echo '(import (srfi :19))' | larceny -err5rs
Larceny v0.97a4 (alpha test) (Apr 15 2009 05:42:48, precise:Linux:unified)
larceny.heap, built on Wed Apr 15 05:48:18 CDT 2009
ERR5RS mode (no libraries have been imported)
Autoloading (srfi :19)
real 0m9.517s
user 0m9.265s
sys 0m0.104s
Hmmm... Well, the SRFI-19 library is just doing a require of the R5RS
implementation, which isn't compiled... And that in turn does a require
Post by Eduardo Cavazos
(time (require 'time))
Words allocated: 19921570
Words reclaimed: 0
Elapsed time...: 3955 ms (User: 3828 ms; System: 24 ms)
Elapsed GC time: 84 ms (CPU: 80 in 19 collections.)
#t

Ed
Eduardo Cavazos
2009-04-15 22:13:52 UTC
Permalink
Post by Eduardo Cavazos
Hmmm... Well, the SRFI-19 library is just doing a require of the R5RS
implementation, which isn't compiled... And that in turn does a require
Compiling 'lib/Standard/time.sch' doesn't help the 4 second load time.
I'm guessing it's because of the cond-expands.

I created a file 'lib/Standard/time-unix.sch' whose contents are the
unix branch of the cond expand. Next, changed 'lib/SRFI/srfi-19.sch' to
require 'time-unix' and removed the cond-expands from that file as well.
I compiled both time-unix and srfi-19. This does the trick:

~ # time echo '(import (srfi :19))' | larceny -err5rs
Larceny v0.97a4 (alpha test) (Apr 15 2009 05:42:48, precise:Linux:unified)
larceny.heap, built on Wed Apr 15 05:48:18 CDT 2009
ERR5RS mode (no libraries have been imported)
Post by Eduardo Cavazos
Autoloading (srfi :19)
real 0m0.844s
user 0m0.764s
sys 0m0.068s

Ed
Eduardo Cavazos
2009-04-16 00:14:01 UTC
Permalink
Post by Eduardo Cavazos
~ # time echo '(import (srfi :19))' | larceny -err5rs
Larceny v0.97a4 (alpha test) (Apr 15 2009 05:42:48, precise:Linux:unified)
larceny.heap, built on Wed Apr 15 05:48:18 CDT 2009
ERR5RS mode (no libraries have been imported)
Autoloading (srfi :19)
real 0m9.517s
user 0m9.265s
sys 0m0.104s
Will,

While I did find a workaround for my local system, it would be nice to
have this fixed in the mainline. Do you think this is doable?

Ed
William D Clinger
2009-04-16 18:39:15 UTC
Permalink
Post by Eduardo Cavazos
While I did find a workaround for my local system, it would be nice to
have this fixed in the mainline. Do you think this is doable?
I'm pretty sure that the public v0.97 release will include
a script that compiles the most important R5RS libraries
as well as the ERR5RS/R6RS libraries. I am almost as sure
that those libraries will come precompiled for the binary
distributions of native Larceny (but not for Petit Larceny
or Common Larceny, because those varieties currently embed
absolute pathnames within compiled files).

Although writing that script is doable by hand, it's hard to
automate the construction of that script because the require
mechanism is so dynamic. One of the main advantages of the
R6RS library syntax is that the dependencies are statically
evident to the compiler.

Will

Loading...