Skip to content

Commit 74f7153

Browse files
committed
Drop total types/fields/methods from build output.
Deprecate these metrics in the build-output-schema and remove already deprecated metrics.
1 parent 5ddfcb9 commit 74f7153

File tree

8 files changed

+478
-40
lines changed

8 files changed

+478
-40
lines changed

docs/reference-manual/native-image/BuildOptions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ There are some expert level options that a user may find useful or needed. For e
119119

120120
Native Image provides an informative [build output](BuildOutput.md) including various statistics during the build process.
121121
The build output in a JSON-based, machine-readable format can be requested using the `-H:BuildOutputJSONFile` option, and later processed by a monitoring tool.
122-
The JSON files validate against the JSON schema defined in [build-output-schema-v0.9.3.json](https://github.com/oracle/graal/blob/master/docs/reference-manual/native-image/assets/build-output-schema-v0.9.3.json).
122+
The JSON files validate against the JSON schema defined in [build-output-schema-v0.9.4.json](https://github.com/oracle/graal/blob/master/docs/reference-manual/native-image/assets/build-output-schema-v0.9.4.json).
123123
A comprehensive report with additional information can be requested using the `--emit build-report` option.
124124

125125
> Note: The `--emit build-report` option is not available in GraalVM Community Edition.

docs/reference-manual/native-image/BuildOutput.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,9 @@ GraalVM Native Image: Generating 'helloworld' (executable)...
3333
- 13.24GB of memory (42.7% of system memory, using available memory)
3434
- 16 thread(s) (100.0% of 16 available processor(s), determined at start)
3535
[2/8] Performing analysis... [****] (4.5s @ 0.54GB)
36-
3,163 reachable types (72.5% of 4,364 total)
37-
3,801 reachable fields (50.3% of 7,553 total)
38-
15,183 reachable methods (45.5% of 33,405 total)
39-
957 types, 81 fields, and 480 methods registered for reflection
40-
57 types, 55 fields, and 52 methods registered for JNI access
36+
3,158 types, 3,625 fields, and 14,804 methods found reachable
37+
1,012 types, 36 fields, and 377 methods registered for reflection
38+
57 types, 57 fields, and 52 methods registered for JNI access
4139
4 native libraries: dl, pthread, rt, z
4240
[3/8] Building universe... (0.8s @ 0.99GB)
4341
[4/8] Parsing methods... [*] (0.6s @ 0.75GB)
@@ -160,9 +158,11 @@ The progress indicator visualizes the number of analysis iterations.
160158
A large number of iterations can indicate problems in the analysis likely caused by misconfiguration or a misbehaving feature.
161159

162160
#### <a name="glossary-reachability"></a>Reachable Types, Fields, and Methods
163-
The number of types (primitives, classes, interfaces, and arrays), fields, and methods that are reachable versus the total number of types, fields, and methods loaded as part of the build process.
164-
A significantly larger number of loaded elements that are not reachable can indicate a configuration problem.
165-
To reduce overhead, please ensure that your class path and module path only contain entries that are needed for building the application.
161+
The number of types (primitives, classes, interfaces, and arrays), fields, and methods that are found reachable by the static analysis.
162+
The reachability metrics give an impression of how small or large the application is.
163+
These metrics can be helpful when compared before and after merging code changes or adding, removing, or upgrading dependencies of an application.
164+
This can help to understand the impact that certain code changes or dependencies have on the overall native binary.
165+
A larger number of reachable types, fields, and methods will also result in a larger native binary.
166166

167167
#### <a name="glossary-reflection-registrations"></a>Reflection Registrations
168168
The number of types, fields, and methods that are registered for reflection.
@@ -391,7 +391,7 @@ This schema also contains descriptions for each possible artifact type and expla
391391

392392
The build output produced by the `native-image` builder is designed for humans, can evolve with new releases, and should thus not be parsed in any way by tools.
393393
Instead, use the `-H:BuildOutputJSONFile=<file.json>` option to instruct the builder to produce machine-readable build output in JSON format that can be used, for example, for building monitoring tools.
394-
Such a JSON file validates against the JSON schema defined in [`build-output-schema-v0.9.3.json`](https://github.com/oracle/graal/tree/master/docs/reference-manual/native-image/assets/build-output-schema-v0.9.3.json).
394+
Such a JSON file validates against the JSON schema defined in [`build-output-schema-v0.9.4.json`](https://github.com/oracle/graal/tree/master/docs/reference-manual/native-image/assets/build-output-schema-v0.9.4.json).
395395
Note that a JSON file is produced if and only if a build succeeds.
396396

397397
The following example illustrates how this could be used in a CI/CD build pipeline to check that the number of reachable methods does not exceed a certain threshold:

0 commit comments

Comments
 (0)