You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/reference-manual/native-image/BuildOptions.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -77,7 +77,7 @@ Run `native-image --help` for help on build options.
77
77
*`--target`: select the compilation target for `native-image` (in the `<OS>-<architecture>` format). It defaults to host's OS-architecture pair.
78
78
*`--trace-class-initialization`: provide a comma-separated list of fully-qualified class names that a class initialization is traced for
79
79
*`--trace-object-instantiation`: provide a comma-separated list of fully-qualified class names that an object instantiation is traced for
80
-
*`-O<level>`: control code optimizations where available variants are: `b` - optimize for fastest build time, `s` - optimize for size, `0` - no optimizations, `1` - basic optimizations, `2` - aggressive optimizations, `3` - all optimizations for best performance (enabled automatically with Profile-Guided Optimizations)
80
+
*`-O<level>`: control code optimizations where available variants are: `b` - optimize for fastest build time, `s` - optimize for size, `0` - no optimizations, `1` - basic optimizations, `2` - aggressive optimizations, `3` - all optimizations for best performance (enabled automatically with Profile-Guided Optimization (PGO))
81
81
*`-da`, `-da[:[packagename]|:[classname]`, `disableassertions[:[packagename]|:[classname]`: disable assertions with specified granularity at run time
82
82
*`-dsa`, `-disablesystemassertions`: disable assertions in all system classes at run time
83
83
*`-ea`, `-ea[:[packagename]|:[classname]`, `enableassertions[:[packagename]|:[classname]`: enable assertions with specified granularity at run time
Copy file name to clipboardExpand all lines: docs/reference-manual/native-image/BuildOutput.md
+5-5
Original file line number
Diff line number
Diff line change
@@ -100,7 +100,7 @@ Use `-Os` to optimize for size.
100
100
The targeted machine type can be selected with the `-march` option and defaults to `x86-64-v3` on AMD64 and `armv8-a` on AArch64.
101
101
See [here](#recommendation-cpu) for recommendations on how to use this option.
102
102
103
-
On Oracle GraalVM, the line also shows information about [Profile-Guided Optimizations (PGO)](#recommendation-pgo).
103
+
On Oracle GraalVM, the line also shows information about [Profile-Guided Optimization (PGO)](#recommendation-pgo).
104
104
-`off`: PGO is not used
105
105
-`instrument`: The generated executable or shared library is instrumented to collect data for PGO (`--pgo-instrument`)
106
106
-`user-provided`: PGO is enabled and uses a user-provided profile (for example `--pgo default.iprof`)
@@ -305,23 +305,23 @@ Use `-march=list` to list all available machine types that can be targeted expli
305
305
The G1 garbage collector is available for your platform.
306
306
Consider enabling it using `--gc=G1` at build time to improve the latency and throughput of your application.
307
307
For more information see the [docs on Memory Management](MemoryManagement.md).
308
-
For best peak performance, also consider using [Profile-Guided Optimizations](#recommendation-pgo).
308
+
For best peak performance, also consider using [Profile-Guided Optimization](#recommendation-pgo).
309
309
310
310
#### <aname="recommendation-heap"></a>`HEAP`: Specify a Maximum Heap Size
311
311
312
312
Please refer to [Maximum Heap Size](#glossary-gc-max-heap-size).
313
313
314
-
#### <aname="recommendation-pgo"></a>`PGO`: Use Profile-Guided Optimizations for Improved Throughput
314
+
#### <aname="recommendation-pgo"></a>`PGO`: Use Profile-Guided Optimization for Improved Throughput
315
315
316
-
Consider using Profile-Guided Optimizations to optimize your application for improved throughput.
316
+
Consider using Profile-Guided Optimization (PGO) to optimize your application for improved throughput.
317
317
These optimizations allow the Graal compiler to leverage profiling information, similar to when it is running as a JIT compiler, when AOT-compiling your application.
318
318
For this, perform the following steps:
319
319
320
320
1. Build your application with `--pgo-instrument`.
321
321
2. Run your instrumented application with a representative workload to generate profiling information in the form of an `.iprof` file.
322
322
3. Re-build your application and pass in the profiling information with `--pgo=<your>.iprof` to generate an optimized version of your application.
323
323
324
-
Relevant guide: [Optimize a Native Executable with Profile-Guided Optimizations](guides/optimize-native-executable-with-pgo.md).
324
+
Relevant guide: [Optimize a Native Executable with Profile-Guided Optimization](guides/optimize-native-executable-with-pgo.md).
325
325
326
326
For best peak performance, also consider using the [G1 garbage collector](#recommendation-g1gc).
Copy file name to clipboardExpand all lines: docs/reference-manual/native-image/OptimizationsAndPerformance.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -24,9 +24,9 @@ The following table provides an overview of the different optimization levels an
24
24
|`-O2`| Advanced |**Default:** Aims for good performance at a reasonable file size. |
25
25
|`-O3`| All | Aims for the best performance at the cost of longer build times. Used automatically by Oracle GraalVM for [PGO builds](guides/optimize-native-executable-with-pgo.md) (`--pgo` option). `-O3` and `-O2` are identical in GraalVM Community Edition. |
26
26
27
-
### Profile-Guided Optimizations for Improved Throughput
27
+
### Profile-Guided Optimization for Improved Throughput
28
28
29
-
Consider using Profile-Guided Optimizations to optimize your application for improved throughput.
29
+
Consider using Profile-Guided Optimization (PGO) to optimize your application for improved throughput.
30
30
These optimizations allow the Graal compiler to leverage profiling information, similar to when it is running as a JIT compiler, when AOT-compiling your application.
Copy file name to clipboardExpand all lines: docs/reference-manual/native-image/WorkshopsAndLabs.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ The following labs are available:
19
19
-[GraalVM Native Image Quick Start](https://luna.oracle.com/lab/47dafec8-4095-4fba-8313-dad43a64dee4): This lab is for developers new to Native Image who are keen to start building cloud native Java applications.
20
20
-[GraalVM, Reflection and Native Image](https://luna.oracle.com/lab/5fde71fb-8044-4c82-aa1c-3f2e5771caed): This lab shows how to preconfigure the `native-image` builder when reflection is used, and make your Java application compatible with ahead-of-time compilation using Native Image.
21
21
-[GraalVM Native Image, Spring and Containerisation](https://luna.oracle.com/lab/fdfd090d-e52c-4481-a8de-dccecdca7d68): This lab shows you how to package a Spring Boot application into a native executable; containerise it; shrink the footprint even more by creating small a Distroless container Image.
22
-
-[Optimize Cloud Native Java Apps with Oracle GraalVM PGO](https://luna.oracle.com/lab/3f0b7c86-6105-4b7a-9a3b-eb73b251a1aa): This lab shows how to run a Java Microbenchmark Harness (JMH) benchmark as a native executable, built with GraalVM Native Image, and then optimize it for higher throughput using Profile-Guided Optimizations (PGO).
22
+
-[Optimize Cloud Native Java Apps with Oracle GraalVM PGO](https://luna.oracle.com/lab/3f0b7c86-6105-4b7a-9a3b-eb73b251a1aa): This lab shows how to run a Java Microbenchmark Harness (JMH) benchmark as a native executable, built with GraalVM Native Image, and then optimize it for higher throughput using Profile-Guided Optimization (PGO).
23
23
-[OCI MySQL, Vault, Micronaut, GraalVM Native Image](https://luna.oracle.com/lab/a78388fd-c15f-48b4-96aa-5e4716ae236c): In this lab, you will learn how to build a portable cloud-native Java application with Micronaut, GraalVM Native Image and MySQL Database service, and Secrets in Vault on Oracle Cloud Infrastructure.
24
24
-[GraalVM Native Build Tools, for Maven](https://luna.oracle.com/lab/e5af592b-3365-45ce-b964-6fd409e5c76f): This lab shows you how to use the GraalVM Native Build Tools to easily build a native executable of your application using Maven. It is aimed at developers with the knowledge of Java.
25
25
-[Build Cloud Native Java Applications with Micronaut and GraalVM Native Image](https://luna.oracle.com/lab/e329af0f-504e-4eb0-8804-2dd6b10076c9): The workshop features several labs that walk you through the steps to get going with Micronaut, GraalVM, and Oracle Cloud Infrastructure services.
Copy file name to clipboardExpand all lines: docs/reference-manual/native-image/guides/optimize-file-size.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -98,7 +98,7 @@ Moreover, build-time initialization, if not used towards a specific goal, can ca
98
98
Generally, it is a good idea to check file size, number of embedded resources, or other metrics from time to time, for example, when adding or updating dependencies, or even monitor build metrics frequently.
99
99
For this, you can use the [machine-readable version of the build output](../BuildOutput.md#machine-readable-build-output) or the [build reports for GitHub Actions](https://medium.com/graalvm/native-image-build-reports-and-update-notifications-351aca964a55){:target="_blank"}.
100
100
101
-
There are other Native Image techniques that can positively affect the executable size, besides improving other metrics, for example, [Profile-Guided Optimizations (PGO)](optimize-native-executable-with-pgo.md).
101
+
There are other Native Image techniques that can positively affect the executable size, besides improving other metrics, for example, [Profile-Guided Optimization (PGO)](optimize-native-executable-with-pgo.md).
# Optimize a Native Executable with Profile-Guided Optimizations
9
+
# Optimize a Native Executable with Profile-Guided Optimization
10
10
11
11
GraalVM Native Image offers quick startup and less memory consumption for a Java application, running as a native executable, by default.
12
-
You can optimize this native executable even more for additional performance gain and higher throughput by applying Profile-Guided Optimizations (PGO).
12
+
You can optimize this native executable even more for additional performance gain and higher throughput by applying Profile-Guided Optimization (PGO).
13
13
14
14
With PGO you can collect the profiling data in advance, and then feed it to the `native-image` tool, which will use this information to optimize the performance of a native application.
15
15
The general workflow is:
@@ -188,7 +188,7 @@ For other installation options, visit the [Downloads section](https://www.graalv
188
188
You should get the performance comparable to, or faster, than the Java version of the program. For example, on a machine with 16 GB of memory and 8 cores, the `TOTAL time` for 10 iterations reduced from ~2200 to ~270 milliseconds.
189
189
190
190
This guide showed how you can optimize native executables for additional performance gain and higher throughput.
191
-
Oracle GraalVM offers extra benefits for building native executables, such as Profile-Guided Optimizations (PGO).
191
+
Oracle GraalVM offers extra benefits for building native executables, such as Profile-Guided Optimization (PGO).
192
192
With PGO you "train" your application for specific workloads and significantly improve the performance.
0 commit comments