Skip to content
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

Native: Introduce flag to favor build time improvements at the cost of using more resources and vice versa #38968

Open
zakkak opened this issue Feb 22, 2024 · 4 comments
Labels

Comments

@zakkak
Copy link
Contributor

zakkak commented Feb 22, 2024

Description

In the past we have used GraalVM flags that result in worse build times for native executables in order to reduce the system resources used at build time, e.g. #21018.

I recently noticed that GraalVM is doing something similar when it comes to configuring the JVM that runs the native image builder, which leads to slower build times when using GraalVM for JDK 21 and GraalVM for JDK 17 in comparison to using the older GraalVM 22.3 in exchange to using less memory at build time.

Although this makes sense in some environments it's a waste of time and resources (as they just stay idle) in others, e.g. in GH runners were we run a single build per runner so we are OK with it using as much memory as possible.

Implementation ideas

I propose the introduction of a new quarkus.native.* property that will control whether we want the native image build to be frugal when it comes to resource usage, or greedy. Instead of a binary switch this could potentially have states, e.g. frugal, balanced, greedy. The value of the property would essentially control the default flags we are passing to GraalVM.

@fniephaus
Copy link

Maybe this is something that we could discuss in a Native Image Committer and Community Meeting?
Bruno Borges' talk on Enhanced Default Ergonomics seems related.
Maybe we can re-use some of that terminology, like --resource-usage=<dedicated|shared>?

@zakkak
Copy link
Contributor Author

zakkak commented Feb 28, 2024

+1 on both suggestion.

Maybe this is something that we could discuss in a oracle/graal#3933?

@fniephaus would you be able to lead this please? Unfortunately, the day and time of the Native Image Committer and Community Meetings does not work very well for me lately and I am not sure I will be able to be present.

@fniephaus
Copy link

would you be able to lead this please?

Sure, could you create an issue for this in oracle/graal and assign it to me?

@zakkak
Copy link
Contributor Author

zakkak commented Feb 28, 2024

Sure, could you create an issue for this in oracle/graal and assign it to me?

Upstream issue tracking this oracle/graal#8468

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants