From d7684d92628138d519bda59d3c653a355a886dc6 Mon Sep 17 00:00:00 2001 From: Olya Gupalo Date: Tue, 15 Oct 2024 16:57:56 +0300 Subject: [PATCH 1/2] Promote PGO options on Optimizations and Performance entry page --- .../OptimizationsAndPerformance.md | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/docs/reference-manual/native-image/OptimizationsAndPerformance.md b/docs/reference-manual/native-image/OptimizationsAndPerformance.md index a908fbd300cc..109daef12060 100644 --- a/docs/reference-manual/native-image/OptimizationsAndPerformance.md +++ b/docs/reference-manual/native-image/OptimizationsAndPerformance.md @@ -24,6 +24,18 @@ The following table provides an overview of the different optimization levels an | `-O2` | Advanced | **Default:** Aims for good performance at a reasonable file size. | | `-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. | +### Profile-Guided Optimizations for Improved Throughput + +Consider using Profile-Guided Optimizations to optimize your application for improved throughput. +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. +For this, perform the following steps: + +1. Build your application with `--pgo-instrument`. +2. Run your instrumented application with a representative workload to generate profiling information. Profiles collected from this run are stored by default in the _default.iprof_ file. +3. Re-build your application and pass in the profiling information with `--pgo=.iprof` to generate an optimized version of your application. If the profile file has the default name, it will be picked up automatically. + +Find more information on this topic in [Basic Usage of Profile-Guided Optimization](../PGO-Basic-Usage.md). + ### Optimizing for Specific Machines Native Image provides a `-march` option that works similarly to the ones in `gcc` and `clang`: it enables users to control the set of instructions that the Graal compiler can use when compiling code to native. @@ -37,7 +49,6 @@ This reduces the set of instructions used by the compiler to a minimum and thus ### Additional Features Native Image provides additional features to further optimize a generated binary: - - - Profile-Guided Optimization (PGO) can provide additional performance gain and higher throughput for most native images. See [Profile-Guided Optimization](PGO.md). - - Choosing an appropriate Garbage Collector and tailoring the garbage collection policy can reduce GC times. See [Memory Management](MemoryManagement.md). - - Loading application configuration during the image build can speed up application startup. See [Class Initialization at Image Build Time](ClassInitialization.md). +- Choosing an appropriate Garbage Collector and tailoring the garbage collection policy can reduce GC times. See [Memory Management](MemoryManagement.md). +- Loading application configuration during the image build can speed up application startup. See [Class Initialization at Image Build Time](ClassInitialization.md). +- The build output may provide some other recommendations that help you get the best out of Native Image. See [Build Output: Recommendations](BuildOutput.md#recommendations). \ No newline at end of file From 82627bb92f8dcbe543c0d62b2d52ac86c7c1a386 Mon Sep 17 00:00:00 2001 From: Olya Gupalo Date: Tue, 15 Oct 2024 16:58:43 +0300 Subject: [PATCH 2/2] Add all Build Output top level titles to quick links list --- docs/reference-manual/native-image/BuildOutput.md | 3 +++ .../native-image/OptimizationsAndPerformance.md | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/reference-manual/native-image/BuildOutput.md b/docs/reference-manual/native-image/BuildOutput.md index 8e553c5bfe08..9784eeacfff8 100644 --- a/docs/reference-manual/native-image/BuildOutput.md +++ b/docs/reference-manual/native-image/BuildOutput.md @@ -9,7 +9,10 @@ redirect_from: /reference-manual/native-image/BuildOutput/ # Native Image Build Output * [Build Stages](#build-stages) +* [Security Report](#security-report) +* [Recommendations](#recommendations) * [Resource Usage Statistics](#resource-usage-statistics) +* [Build Artifacts](#build-artifacts) * [Machine-Readable Build Output](#machine-readable-build-output) Here you will find information about the build output of GraalVM Native Image. diff --git a/docs/reference-manual/native-image/OptimizationsAndPerformance.md b/docs/reference-manual/native-image/OptimizationsAndPerformance.md index 109daef12060..caf0224b3cc5 100644 --- a/docs/reference-manual/native-image/OptimizationsAndPerformance.md +++ b/docs/reference-manual/native-image/OptimizationsAndPerformance.md @@ -32,7 +32,7 @@ For this, perform the following steps: 1. Build your application with `--pgo-instrument`. 2. Run your instrumented application with a representative workload to generate profiling information. Profiles collected from this run are stored by default in the _default.iprof_ file. -3. Re-build your application and pass in the profiling information with `--pgo=.iprof` to generate an optimized version of your application. If the profile file has the default name, it will be picked up automatically. +3. Rebuild your application with the `--pgo` option. You can pass a custom _.iprof_ file with `--pgo=.iprof`, otherwise _default.iprof_ is used. This will rebuild your image and generate an optimized version of your application. Find more information on this topic in [Basic Usage of Profile-Guided Optimization](../PGO-Basic-Usage.md).