Skip to content

pkgimages: storage of link_ids should be compressed #48218

@timholy

Description

@timholy

Towards the end of writing out pkgimages, we write a section of link_ids:

julia/src/staticdata.c

Lines 2477 to 2484 in 1e5fdb2

write_uint32(f, jl_array_len(s.link_ids_gctags));
ios_write(f, (char*)jl_array_data(s.link_ids_gctags), jl_array_len(s.link_ids_gctags)*sizeof(uint64_t));
write_uint32(f, jl_array_len(s.link_ids_relocs));
ios_write(f, (char*)jl_array_data(s.link_ids_relocs), jl_array_len(s.link_ids_relocs)*sizeof(uint64_t));
write_uint32(f, jl_array_len(s.link_ids_gvars));
ios_write(f, (char*)jl_array_data(s.link_ids_gvars), jl_array_len(s.link_ids_gvars)*sizeof(uint64_t));
write_uint32(f, jl_array_len(s.link_ids_external_fnvars));
ios_write(f, (char*)jl_array_data(s.link_ids_external_fnvars), jl_array_len(s.link_ids_external_fnvars)*sizeof(uint64_t));

These store the buildid of the module for an external linkage; they act as an invariant name for a module we depend on, and are used for pointer relocation when we deserialize.

It turns out these are quite repetitious, and the large majority of such linkages are against the sysimage with buildid 0. Consequently we should be able to store them with some form of compression. This will only modestly shrink the size of pkgimages (maybe 5%ish), but it seems worth having.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions