staticdata: the system image holds nothing, the boxed integers and its symbols - #63068
Open
levy wants to merge 2 commits into
Open
staticdata: the system image holds nothing, the boxed integers and its symbols#63068levy wants to merge 2 commits into
nothing, the boxed integers and its symbols#63068levy wants to merge 2 commits into
Conversation
This was referenced Sep 8, 2026
levy
force-pushed
the
pr-image-primordials
branch
3 times, most recently
from
September 8, 2026 11:57
75a2510 to
81598dd
Compare
xal-0
self-requested a review
September 8, 2026 15:45
A package image references them by tag, since they belong to the loading runtime. The system image is that runtime, so it serializes them as objects, and a field that points at one needs no relocation. `jl_nothing` is already read from the image as a constant global. `julia_init` allocates one before the root task exists, so the root task's fields that hold that one are updated after the relocations, by a walk over the task layout. Boxed integers need no adoption: two boxes of one value are equal by value. A trimmed image keeps the tag encoding, to stay small. Assisted-by: Claude Code (Opus 5)
A package image references a symbol by its index in a name list, and the loader interns the list. The system image did the same, so every start interned tens of thousands of names and wrote one pointer per reference. The system image now serializes its symbols as objects, with their two tree children, and records the root. The loader installs that tree as the symbol table of the process after the relocations; a symbol interned later goes into the same tree. `jl_init_common_symbols` runs after the restore, and `jl_set_root_symbol` refuses a non-empty table. A trimmed image keeps the name list, to stay small. `julia --startup-file=no -e ''`: 66.8 → 61.4 ms, minimum of 15 pinned runs, on top of the lowering-context change. `sys.so` grows 2.3 MB. `test/cmdlineargs.jl` checks that a started process finds `nothing`, the booleans, an image symbol, a freshly interned symbol and the root task's `nothing` fields in the image, and that a new random symbol is not. Assisted-by: Claude Code (Opus 5)
levy
force-pushed
the
pr-image-primordials
branch
from
September 8, 2026 16:42
81598dd to
b8b54f2
Compare
Member
|
These PR titles don't really make any sense to me. "the system image holds nothing". Wat? Holds? |
Contributor
Author
I'm sorry for the confusing title, it really is confusing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A package image references
nothing, the small boxed integers and every symbol by tag, and the loader resolves the tag to an object of the loading runtime. The system image is that runtime, so paying the same way costs it 1.1 million relocations at every start, plus the interning of the whole symbol list. This serializes them as objects instead.nothing: the loader already readsjl_nothingfrom the image.julia_initallocates one earlier, so the fields of the root task that still point at that one are updated after the relocations, by a walk over the task layout.jl_init_common_symbolsmoves after the restore, andjl_set_root_symbolrefuses a non-empty table.A trimmed image (
--trim) keeps the tag encoding: the symbol table is about 2.6 MB, more than a whole trimmed binary.test/trimand the JuliaC tests pass; the trimmed hello world is 1.66 MB and starts in 3.3 ms. Pruning the table to the referenced symbols would be the better answer; it is not in this PR.julia --startup-file=no -e '', minimum of 15 pinned runs, on top of #63067: 66.2 → 61.4 ms.sys.sogrows 2.3 MB.Test:
test/cmdlineargs.jlchecks withjl_object_in_imagethat a started process findsnothing, the booleans, an image symbol, a freshly interned symbol and thenothingfields of the root task in the image, and that a random new symbol is not.core,channels,precompile,syntaxandmetapass.Part of #63065. #63069 needs it to keep the residual list short.
Disclosure: developed with Claude Code (Opus 5) under my direction. It wrote the code and this text; the measurements were run on my machine. I reviewed the changes. The commits carry an
Assisted-bytrailer.