﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	difficulty
1457	module/import information in statically linked executables has massive runtime overhead	felix winkelmann		"While experimenting with statically linked eggs, klm noticed that a simple empty program has a considerable startup time (several seconds). So, for example, the following program:

{{{
(import parley)
(print 'hello)
}}}

compiled like this:

{{{
csc -static hello.scm
}}}

then `./hello -:d` will show the initialization sequence, where particular units need quite long to initialize. All of the overhead is very likely to be caused by module registration code and import resolution.

If I instrument `chicken-install` (actually `egg-compile.scm`) to pass `-no-module-registration`, then the overhead is gone. But this will prevent the use of import in evaluated code for all but the core modules (those provided by the `eval-modules` unit).

I'm not sure what to do now. I personally think it's acceptable to require for statically linked executables not to use `eval`, but that does of course not apply to all users. An alternative would be to trigger the module registration lazily, on the first use of `import`, but that may be difficult to change in the compiler or may result in registration ordering issues.

Another option would be a build-time option that decides whether static extensions should be compiled with `-no-module-registration`.
"	defect	closed	major	5.0	extensions	5.0.0	fixed		sjamaan evhan kristianlm	hard
