Opened 11 years ago
Closed 8 years ago
#1172 closed defect (fixed)
The overhead of loading import files is noticable
| Reported by: | sjamaan | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 5.0 |
| Component: | core libraries | Version: | 4.9.x |
| Keywords: | modules, loading | Cc: | |
| Estimated difficulty: | hard |
Description
As reported by CaptainRant via IRC, the overhead in loading a .import.scm is quite a lot. This is an issue for CaptainRant in a project that involves loading plugins into a running binary.
Attached is a simple test case that compares loading a full module versus a simple "unit" style dynamic object.
The biggest overhead is in the call to "eval" in the generated import file. This can be ripped out with no consequence to the loading of the plugin; this may be due to the simplicity of the plugin or really due to the fact that there's no code running at toplevel which requires the evaled import. In any case, this should be improved.
Attachments (2)
Change History (8)
by , 11 years ago
| Attachment: | module-loading-benchmark.tar.gz added |
|---|
comment:1 by , 10 years ago
| Milestone: | someday → 5.0 |
|---|
comment:2 by , 9 years ago
| Estimated difficulty: | → hard |
|---|
comment:3 by , 9 years ago
| Milestone: | 5.0 → 5.1 |
|---|
Can be done without user-visible changes, I think, so no reason to delay 5.0 for it.
by , 8 years ago
| Attachment: | module-loading-benchmark.tar.2.gz added |
|---|
module benchmark, chicken 5 version
comment:5 by , 8 years ago
| Milestone: | 5.1 → 5.0 |
|---|
I think this is fixed with the patch for #1457:
Without the patch:
$ ./benchmark-loader >>> loading 'plugin.so' 0.052s CPU time, 3197/867 mutations (total/tracked), 3/85 GCs (major/minor), maximum live heap: 639.83 KiB >>> loading 'unit-plugin.so' 0s CPU time, 61/22 mutations (total/tracked), 0/1 GCs (major/minor), maximum live heap: 640.27 KiB
With the patch:
>>> loading 'plugin.so' 0s CPU time, 85/44 mutations (total/tracked), 0/1 GCs (major/minor), maximum live heap: 301.5 KiB >>> loading 'unit-plugin.so' 0.004s CPU time, 61/22 mutations (total/tracked), 0/1 GCs (major/minor), maximum live heap: 301.94 KiB
So we can close this when accepted.

If we're going to change import stuff for CHICKEN 5, might as well take this into consideration