Skip to content

Commit df92929

Browse files
committed
[GR-55097] Link update in native-image/Resources.md.
PullRequest: graal/18217
2 parents 07a2c6a + 3f6137a commit df92929

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ There are several ways a resource can be registered for inclusion and be made ac
2020

2121
A resource configuration file contains information about the resources that you need to include in a native executable, encoded with patterns matching actual resources on your file system.
2222
Such a configuration file has to be named _resource-config.json_ and placed in the _META-INF/native-image/_ directory so that `native-image` will automatically make use of it.
23-
You can either generate it using the [Tracing Agent](AutomaticMetadataCollection/#tracing-agent), and then manually refine it, or create it from scratch.
23+
You can either generate it using the [Tracing Agent](AutomaticMetadataCollection.md#tracing-agent), and then manually refine it, or create it from scratch.
2424
You can choose one of the formats to specify the required resources (or combine them if necessary):
2525
1. Globs (**recommended**)
2626
2. Regular expressions (Regex) (**discouraged**)
@@ -56,7 +56,7 @@ Alternatively, the configuration file's path can be passed to `native-image` usi
5656
### Globs
5757

5858
You can write a glob pattern to specify any required resources in the `globs` section of the configuration file.
59-
Also, if you use the [Tracing Agent](AutomaticMetadataCollection/#tracing-agent) to generate the required configuration, it prints all entries in this format.
59+
Also, if you use the [Tracing Agent](AutomaticMetadataCollection.md#tracing-agent) to generate the required configuration, it prints all entries in this format.
6060

6161
Globs are the recommended way to provide resources for `native-image` because they:
6262
* Have custom handling in `native-image` that can speed up a resource registration process

docs/reference-manual/native-image/guides/specify-class-initialization.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,14 @@ The parser creates records and adds them to a `List<Talk>` collection.
119119
- Bootiful Spring Boot 3 by Josh Long
120120
./buildtime-parser 0.00s user 0.00s system 53% cpu 0.016 total
121121
```
122+
122123
Check the file size which should decrease to around 6.4M!
123-
```
124+
```bash
124125
du -sh buildtime-parser
125126
```
127+
126128
The file size change is because Native Image runs the static initializer at build time, parsing the text block, and persisting only the `Talk` records in the executable.
129+
127130
As a result, the majority of the scanning infrastructure does not become reachable when Native Image statically analyzes the application and is, therefore, not included in the executable.
128131

129132
Another valuable criterion for profiling applications more accurately is the number of instructions, which can be obtained using the [Linux `perf` profiler](../PerfProfiling.md).
@@ -164,6 +167,7 @@ Talks loaded using scanner:
164167

165168
This demonstrates how Native Image can shift work from runtime to build time: when the class is initialized at build time, the text block is parsed when the executable is being built and only the parsed objects are included.
166169
This not only makes the executable smaller in file size, but also faster to run: when the executable runs, the `Talk` records already exist and only need to be printed.
170+
<br>
167171

168172
To ensure native executables built with Native Image are as compatible as possible with the HotSpot behavior, application classes that cannot be safely initialized at build time, are initialized at runtime.
169173
You as a user, or a framework that you use, must explicitly request build-time initialization for certain classes to benefit from smaller file sizes and faster times to run.

0 commit comments

Comments
 (0)