Skip to content

Conversation

xal-0
Copy link
Member

@xal-0 xal-0 commented Aug 20, 2025

This is #59227 manually backported to 1.11, along with the dependencies #57523,
#57542, and a modified version of #58344 that adds the zstd jll but does not
make any of the LLVM changes.

@giordano
Copy link
Member

This is #31518 manually backported to 1.11

That looks unrelated (was this the magic github issue number autocompletion?)

@nsajko
Copy link
Contributor

nsajko commented Aug 20, 2025

The PR #59227 should be linked instead, I think.

@topolarity topolarity changed the base branch from backports-release-1.11 to release-1.11 August 20, 2025 11:38
@topolarity topolarity added the DO NOT MERGE Do not merge this PR! label Aug 20, 2025
@topolarity topolarity force-pushed the compressed-sysimg-1.11 branch from 1fe2358 to 82e2dc4 Compare August 20, 2025 11:42
topolarity and others added 4 commits August 20, 2025 07:54
Inspired by a bug I hit on MinGW recently with weak symbol resolution.
I'm not sure why we started using these in
70000ac, since I believe we should be
able to lookup these symbols just fine in our `jl_exe_handle` as long as
it was linked / compiled with `-rdynamic`

Migrating away from weak symbols seems a good idea, given their uneven
implementation across platforms.

(cherry picked from commit 4a6ada6)
Introduce `jl_image_buf_t` to represent the in-memory details of an
unparsed system image and clean-up several global variables and split
loading logic in staticdata.c so that we get (almost) everything we need
from the sysimage handle at once.

This allows sysimage loading to be separated into three phases:
  1. Lookup the raw sysimage buffer as a `jl_image_buf_t`
2. For .so sysimages, parse the sysimage and initialize JIT targets,
etc.
  3. Finally load the sysimage into a `jl_image_t`

Care was taken to preserve the existing behavior of calling
`jl_set_sysimg_so` to configure the sysimage before initializing Julia,
although this is likely to be next on the chopping block in a follow-up.

Dependent on JuliaLang#57523.
Co-authored-by: Gabriel Baraldi <[email protected]>

madvise with MADV_WILLNEED before accessing sysimage pages

MADV_WILLNEED sysimage pages before checksumming or decompressing

Even without compression, this gives about an 8% improvement in load times.

Fix using jl_page_size before it is initialized

Add zstd to ANALYSIS_DEPS now that it is used in staticdata.c

Fix jl_page_size being uninitialized in jl_prefetch_system_image

Add --compress-sysimage flag; use zstd-15 when enabled
@topolarity topolarity force-pushed the compressed-sysimg-1.11 branch from 82e2dc4 to 5c227a2 Compare August 20, 2025 11:54
@topolarity
Copy link
Member

Looks like the backports-release-1.11 branch is bad right now: https://buildkite.com/julialang/julia-release-1-dot-11/builds/486#0198c40b-bb01-4034-92ec-0888d1a38c60/897-1503

Took the liberty of re-targeting this to release-1.11, just to have useful CI until backports is green again.

@xal-0 xal-0 changed the title Compressed sysimage using zstd (manual 1.11 backport Compressed sysimage using zstd (manual 1.11 backport) Aug 20, 2025
@xal-0
Copy link
Member Author

xal-0 commented Aug 20, 2025

That looks unrelated (was this the magic github issue number autocompletion?)

This is what I get for trusting the GitHub textbox instead of pasting in text
from a program that won't randomly change what I wrote.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DO NOT MERGE Do not merge this PR!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants