Skip to content

[GR-72512] Speed up native-image --version, --help, and --help-extra.#12814

Merged
graalvmbot merged 3 commits into
masterfrom
fniephaus/GR-72512/help-version
Jan 15, 2026
Merged

[GR-72512] Speed up native-image --version, --help, and --help-extra.#12814
graalvmbot merged 3 commits into
masterfrom
fniephaus/GR-72512/help-version

Conversation

@graalvmbot
Copy link
Copy Markdown
Collaborator

@graalvmbot graalvmbot commented Jan 14, 2026

This PR speeds up the --version, --help, and --help-extra flags by handling them before any class loader is used to load the user application and process META-INF/native-image directories. Note that --help and --help-extra can be frequently used via the bash completion, and --version by the Native Build Tools to perform version checks.

# Before
$ hyperfine 'native-image --version'
Benchmark 1: native-image --version
  Time (mean ± σ):      69.3 ms ±   3.4 ms    [User: 55.0 ms, System: 32.8 ms]
  Range (min … max):    56.8 ms …  78.7 ms    41 runs
 
# After
$ hyperfine '$GRAALVM_HOME/bin/native-image --version'
Benchmark 1: $GRAALVM_HOME/bin/native-image --version
  Time (mean ± σ):       6.4 ms ±   2.7 ms    [User: 1.8 ms, System: 1.8 ms]
  Range (min … max):     0.6 ms …  11.1 ms    182 runs

# Before
$ hyperfine 'native-image --help'
Benchmark 1: native-image --help
  Time (mean ± σ):      71.9 ms ±   3.0 ms    [User: 55.2 ms, System: 33.0 ms]
  Range (min … max):    66.4 ms …  81.8 ms    38 runs

# After
$ hyperfine '$GRAALVM_HOME/bin/native-image --help'
Benchmark 1: $GRAALVM_HOME/bin/native-image --help
  Time (mean ± σ):      10.0 ms ±   2.8 ms    [User: 2.5 ms, System: 4.3 ms]
  Range (min … max):     4.1 ms …  15.4 ms    145 runs

@oracle-contributor-agreement oracle-contributor-agreement Bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jan 14, 2026
@graalvmbot graalvmbot changed the title Speed up native-image --version, --help, and --help-extra. [GR-72512] Speed up native-image --version, --help, and --help-extra. Jan 15, 2026
@graalvmbot graalvmbot closed this Jan 15, 2026
@graalvmbot graalvmbot deleted the fniephaus/GR-72512/help-version branch January 15, 2026 10:48
@graalvmbot graalvmbot merged commit 580a139 into master Jan 15, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants