-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lazy System Properties for native image #45997
Conversation
Status for workflow
|
@radcortez could you point me to where |
Yes, for the log pattern formatter:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
core/runtime/src/main/java/io/quarkus/runtime/configuration/Substitutions.java
Show resolved
Hide resolved
@zakkak friendly ping :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good to me but way more "intrunsive" than expected.
@radcortez do you see any reason not to propose this change to upstream Graal?
Yes, I wanted to propose something to fix the issue there, but I also wanted to have something to quickly fix the problem on our side |
FWIW, I agree on the fact that's it's too intrusive. Let's try to improve upstream! |
Yes. I'll open up an issue, and I can also submit a PR to them. |
Upstream has changed this class quite a bit https://github.com/oracle/graal/blob/master/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/SystemPropertiesSupport.java so you would first need to check if the issue is still reproducible with the latest GraalVM (you can get a build from https://github.com/graalvm/graalvm-ce-dev-builds/releases |
quarkusio#45997 breaks compatibility with GraalVM for JDK 25 as the method being substituted doesn't exist there.
quarkusio#45997 breaks compatibility with GraalVM for JDK 25 as the method being substituted doesn't exist there.
I opened this one on Graal VM side: oracle/graal#10630 |
quarkusio#45997 breaks compatibility with GraalVM for JDK 25 as the method being substituted has been renamed.
The GraalVM provides a lazy implementation to access system properties that are expensive to calculate: https://github.com/oracle/graal/blob/master/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/SystemPropertiesSupport.java
Still, it ends up calculating all the properties anyway when
System#getProperties()
is called, which is a common call. Used, for instance, to get the list of names in Quarkus configuration, but also inGetPropertyAction#privilegedGetProperties()
which is used in many JVM APIs, for instance, when determining the default timezone. Such initialization may cost a few milliseconds of the native image startup time (measured between 5-6, depending on the system).https://quarkusio.zulipchat.com/#narrow/channel/187038-dev/topic/System.20Properties.20in.20Native.20Image.20.285.20to.206.20ms.20startup.20time.29