[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-janitors] #1457: module/import information in statically linked
From: |
Chicken Trac |
Subject: |
[Chicken-janitors] #1457: module/import information in statically linked executables has massive runtime overhead |
Date: |
Sun, 29 Apr 2018 20:13:19 -0000 |
#1457: module/import information in statically linked executables has massive
runtime overhead
------------------------+--------------------------------
Reporter: felix | Owner:
Type: defect | Status: new
Priority: major | Milestone: someday
Component: extensions | Version: 4.13.0
Keywords: | Estimated difficulty: hard
------------------------+--------------------------------
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`.
--
Ticket URL: <https://bugs.call-cc.org/ticket/1457>
CHICKEN Scheme <https://www.call-cc.org/>
CHICKEN Scheme is a compiler for the Scheme programming language.
- [Chicken-janitors] #1457: module/import information in statically linked executables has massive runtime overhead,
Chicken Trac <=