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/java/compiler.md
+13-9Lines changed: 13 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,13 +23,12 @@ GraalVM includes a version of the HotSpot JVM that supports JVMCI.
23
23
## Compiler Advantages
24
24
25
25
The Graal compiler provides optimized performance for programs running on the JVM through unique approaches to code analysis and optimization.
26
-
It includes multiple optimization algorithms (called “Phases”), like aggressive inlining, polymorphic inlining, and others.
27
-
For example, the compiler in Oracle GraalVM includes 62 optimization phases, of which 27 are patented.
26
+
It includes multiple optimization algorithms (called “Phases”), like aggressive inlining, polymorphic inlining, and others.
27
+
Find some of the platform-independent compiler optimizations in GraalVM Community Edition [here](https://github.com/oracle/graal/blob/master/compiler/src/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/CEOptimization.java).
28
28
29
-
The Graal compiler assures performance advantages for highly-abstracted programs due to its ability to remove costly object allocations.
30
-
Code using more abstraction and modern Java features like Streams or Lambdas will see greater speedups.
31
-
Low-level code or code that converges to things like I/O, memory allocation, or garbage collection will see less improvement.
32
-
Consequently, an application running on GraalVM needs to spend less time doing memory management and garbage collection.
29
+
The Graal compiler can bring performance advantages for highly-abstracted programs. For example, it includes a [partial-escape-analysis optimization](https://www.javadoc.io/static/org.graalvm.compiler/compiler/22.3.1/org/graalvm/compiler/core/phases/CEOptimization.html#PartialEscapeAnalysis) that can remove costly allocations of certain objects.
30
+
This optimization determines when a new object is accessible outside a compilation unit and only allocates it on paths that "escape" the compilation unit (e.g. the object is passed as a parameter, stored in a field, or returned from a method). This can greatly improve performance of an application by reducing the number of heap allocations.
31
+
Code using more modern Java features like Streams or Lambdas will see greater speedups as this type of code involves a significant number of such non- or partially-escaping objects. Code that is bound by things like I/O or memory allocations that cannot be removed by the compiler will see less improvement.
33
32
For more information on performance tuning, refer to [Compiler Configuration on JVM](Options.md).
34
33
35
34
## Graph Compilation
@@ -53,7 +52,7 @@ The pipeline for such compilation is:
53
52
54
53
Besides the Truffle framework, GraalVM incorporates its optimizing compiler into an advanced ahead-of-time (AOT) compilation technology -- [Native Image](../native-image/README.md) -- which translates Java and JVM-based code into a native platform executable.
55
54
These native executables start nearly instantaneously, are smaller, and consume less resources of the same Java application, making them ideal for cloud deployments and microservices.
56
-
For more information about AOT compilation, go to [Native Image](../native-image/README.md).
55
+
For more information about the AOT compilation, go to [Native Image](../native-image/README.md).
57
56
58
57
## Compiler Operating Modes
59
58
@@ -82,6 +81,11 @@ This will produce diagnostic data for every method compiled by the compiler.
82
81
To refine the set of methods for which diagnostic data is produced, use the `-Dgraal.MethodFilter=<class>.<method>` option.
83
82
For example, `-Dgraal.MethodFilter=java.lang.String.*,HashMap.get` will produce diagnostic data only for methods in the `java.lang.String` class as well as methods named `get` in a class whose non-qualified name is `HashMap`.
84
83
85
-
Instead of being written to a file, diagnostic data can also be sent over the network to the [Ideal Graph Visualizer](../../tools/ideal-graph-visualizer.md).
84
+
Instead of being written to a file, diagnostic data can also be sent over the network to the [Ideal Graph Visualizer](https://www.graalvm.org/latest/tools/igv/).
86
85
This requires the `-Dgraal.PrintGraph=Network` option, upon which the compiler will try to send diagnostic data to _127.0.0.1:4445_.
87
-
This network endpoint can be configured with the `-Dgraal.PrintGraphHost` and `-Dgraal.PrintGraphPort` options.
86
+
This network endpoint can be configured with the `-Dgraal.PrintGraphHost` and `-Dgraal.PrintGraphPort` options.
0 commit comments