I posted a note similar to this one to comp.lang.scheme.scsh, but haven't seen
a response, so this time I'll use the bug mailing list ...
I've built scsh on a few different kinds of machines. At least on NextStep
and Solaris, the call to init-scsh-hindbrain in scsh-stand-alone-resumer is
responsible for about half of scsh's startup delay. If I change the
argument to init-scsh-hindbrain from #t to #f, then scsh starts up much
faster. Surprisingly, it also still seems to work.
Can you explain what's going on and why the call is necessary. It seems that
scsh is working to find the location of C functions it needs. Maybe this work
is not needed on all architectures, since the functions it looks for will
always be at the same address. Maybe the work can be done lazily, so that
scsh starts up faster.
bob
====================
(define (scsh-stand-alone-resumer start)
(usual-resumer ;sets up exceptions, interrupts, and current input & output
(lambda (args) ; VM gives us our args, but not our program.
===> (init-scsh-hindbrain #t) ; Whatever. Relink & install scsh's I/O system.
(call-with-current-continuation
(lambda (halt)
(set! %vm-prog-args (cons "scsh" args)) ; WRONG -- use image.
(set-command-line-args! %vm-prog-args)
(with-handler (simple-condition-handler halt (error-output-port))
(lambda ()
(let ((exit-val (start (command-line))))
(if (integer? exit-val) exit-val 0))))))))) ; work around bug.
|