Profile-Guided Optimization (PGO) is a new feature of Excelsior JET 12 that enables the AOT compiler to base many optimization decisions on an actual execution profile of the application being compiled, as opposed to heuristics and generic data.
Important For PGO to be effective, it is paramount that you collect a profile representative of the future behaviour of your application in a production environment.
As of version 12, profile-guided optimization is supported by the following products:
- 64-bit Excelsior JET, Enterprise Edition for Windows, OS X, and Linux
- 64-bit Excelsior JET Embedded for Windows and Linux
- Excelsior JET Embedded for Linux/ARM
Using Profile-Guided Optimization
To find out whether PGO may considerably improve the performance of your application, do the following:
Step 1. Collect an execution profile
Launch your natively compiled application with the
property set, and run it through some performance-challenging scenarios,
either manually or by supplying the necessary input data.
How do I set system properties at application launch?
On application exit, an
AppName.jprof file will be created in the current directory.
Step 2. Enable PGO and re-build the project
For projects created with a prior version of Excelsior JET:
Add the following two options to your project file, or to the command line
of the Excelsior JET AOT compiler (
and re-build your project.
For new projects:
By default, the JET Control Panel adds the above settings to all newly created projects and
creates an empty
AppName.jprof file in the build directory.
All you need to enable PGO is replace that empty file with the one created on Step 1 and re-build
In most cases, this step takes much less time than a full build, as the compiler only needs to process a few classes selected by the PGO engine.
Step 3 (optional). Try applying PGO to platform classes as well
Your application may be spending a lot of CPU time in the code of Java Platform API classes, such as standard collections. Adding the platform classes to the scope of PGO could therefore improve the performance of your application further, and that improvement can be quite significant. Enabling the Global Optimizer will do exactly that.
You can enable the Global Optimizer on the Classes page of the JET Control Panel,
or by adding the option
-global+ to the project file or the
jc command line.
Notice There is no need to re-collect the execution profile as it already contains the necessary information for the platform classes.
From version 12, the Global Optimizer is available for all target platforms supported by Excelsior JET.
If the file
AppName.jprofalready exists, it gets overwritten without a warning, and profile merging is not implemented yet. This means that an execution profile must be collected in a single session.
You cannot supply more than one
.jproffile to the compiler, because yes, profile merging is not implemented yet.
- The executables that were built with PGO enabled cannot themselves be run in the profiling mode.
The above limitations will be removed in the next major release of Excelsior JET.
The 32-bit versions of Excelsior JET for Windows and Linux support
profiling, but do not support PGO. More precisely, they recognize
-pgo+option, but it has no effect. This enables you to use the same project files for 32- and 64-bit builds, but only the latter would benefit from PGO.
This limitation will not be removed in the next major release, as that requires more than one development cycle.