Skip to content

Commit 6161664

Browse files
authored
Merge pull request #323 from graalvm/archive-demos-4
[GR-60094] Review and move native-image-configure-examples to archive.
2 parents 220a27e + 33e41e7 commit 6161664

File tree

23 files changed

+19
-33
lines changed

23 files changed

+19
-33
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,36 @@
1-
name: native-image-configure-examples
1+
name: archive/class-initialization-examples
22
on:
33
push:
44
paths:
5-
- 'native-image-configure-examples/**'
6-
- '.github/workflows/native-image-configure-examples.yml'
5+
- 'archive/class-initialization-examples/**'
6+
- '.github/workflows/archive-class-initialization-examples.yml'
77
pull_request:
88
paths:
9-
- 'native-image-configure-examples/**'
10-
- '.github/workflows/native-image-configure-examples.yml'
11-
schedule:
12-
- cron: "0 0 1 * *" # run every month
9+
- 'archive/class-initialization-examples/**'
10+
- '.github/workflows/archive-class-initialization-examples.yml'
1311
workflow_dispatch:
1412
permissions:
1513
contents: read
1614
jobs:
1715
run:
18-
name: Run 'native-image-configure-examples'
16+
name: Run 'archive/class-initialization-examples'
1917
runs-on: ubuntu-latest
2018
timeout-minutes: 15
21-
strategy:
22-
matrix:
23-
java-version: ['21', 'latest-ea']
2419
steps:
2520
- uses: actions/checkout@v4
2621
- uses: graalvm/setup-graalvm@v1
2722
with:
28-
java-version: ${{ matrix.java-version }}
23+
java-version: '21'
2924
distribution: 'graalvm'
3025
github-token: ${{ secrets.GITHUB_TOKEN }}
3126
cache: 'maven'
3227
- name: Run 'configure-at-runtime-example'
3328
run: |
34-
cd native-image-configure-examples/configure-at-runtime-example
29+
cd archive/class-initialization-examples/configure-at-runtime-example
3530
mvn --no-transfer-progress package
3631
./target/runtime-example
3732
- name: Run 'configure-at-buildtime-example'
3833
run: |
39-
cd native-image-configure-examples/configure-at-buildtime-example
34+
cd archive/class-initialization-examples/configure-at-buildtime-example
4035
mvn --no-transfer-progress package
4136
./target/buildtime-example

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ cd graalvm-demos
4848
<td align="left" width="70%">Demonstrates how the Graal compiler can achieve better performance for highly abstracted programs like those using Streams, Lambdas<br><strong>Technologies: </strong>Graal compiler, C2<br><strong>Reference: </strong><a href="https://luna.oracle.com/lab/d502417b-df66-45be-9fed-a3ac8e3f09b1/steps#task-2-run-demos-java-microbenchmark-harness-jmh">Simple Java Stream Benchmark</a></td>
4949
</tr>
5050
<tr>
51-
<td align="left" width="30%"><a href="/native-image-configure-examples/">native-image-configure-examples</a><br><a href="https://github.com/graalvm/graalvm-demos/actions/workflows/streams.yml"><img alt="streams" src="https://github.com/graalvm/graalvm-demos/actions/workflows/streams.yml/badge.svg" /></a></td>
52-
<td align="left" width="70%">Demonstrates how you can influence the classes initialization at the image build time<br><strong>Technologies: </strong>Native Image, Maven<br><strong>Reference: </strong><a href="https://medium.com/graalvm/understanding-class-initialization-in-graalvm-native-image-generation-d765b7e4d6ed">Understanding Class Initialization in GraalVM Native Image Generation</a></td>
51+
<td align="left" width="30%"><a href="/multithreading-demo/">multithreading-demo</a><br><a href="https://github.com/graalvm/graalvm-demos/actions/workflows/streams.yml"><img alt="streams" src="https://github.com/graalvm/graalvm-demos/actions/workflows/streams.yml/badge.svg" /></a></td>
52+
<td align="left" width="70%">Demonstrates how to optimize a Java application that does synchronous and asynchronous threads execution<br><strong>Technologies: </strong>Native Image Build Reports, Native Build Tools Maven plugin <br><strong>Reference: </strong><a href="https://medium.com/graalvm/making-sense-of-native-image-contents-741a688dab4d">Making sense of Native Image contents</a></td>
5353
</tr>
5454
<tr>
5555
<td align="left" width="30%"><a href="/javagdbnative/">javagdbnative</a><br><a href="https://github.com/graalvm/graalvm-demos/actions/workflows/javagdbnative.yml"><img alt="javagdbnative" src="https://github.com/graalvm/graalvm-demos/actions/workflows/javagdbnative.yml/badge.svg" /></a></td>

native-image-configure-examples/README.md renamed to archive/class-initialization-examples/README.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,28 +20,28 @@ In both examples we use the Jackson framework to parse a JSON file to determine
2020

2121
1. Download and install the latest GraalVM JDK using [SDKMAN!](https://sdkman.io/).
2222
```bash
23-
sdk install java 21.0.1-graal
23+
sdk install java 21.0.5-graal
2424
```
2525

26-
2. Download or clone the repository and navigate into the `native-image-configure-examples` directory:
26+
2. Download or clone the repository and navigate into the `class-initialization-examples` directory:
2727
```bash
2828
git clone https://github.com/graalvm/graalvm-demos
2929
```
3030
```bash
31-
cd graalvm-demos/native-image-configure-examples
31+
cd graalvm-demos/archive/class-initialization-examples
3232
```
3333

3434
## Build and Run Examples
3535

3636
1. Change to one of the demo subdirectories, for example, `configure-at-runtime-example`:
3737
```bash
38-
cd graalvm-demos/native-image-configure-examples/configure-at-runtime-example
38+
cd configure-at-runtime-example
3939
```
4040
2. Build the project:
4141
```bash
4242
mvn package
4343
```
44-
3. Once the Maven build succeeds, a native executable called "runtime-example" will be generated in the `configure-at-runtime-example/target/` directory. Run it:
44+
3. Once the Maven build succeeds, a native executable called "runtime-example" will be generated in the _configure-at-runtime-example/target/_ directory. Run it:
4545
```bash
4646
./target/runtime-example
4747
```
@@ -63,7 +63,4 @@ In both examples we use the Jackson framework to parse a JSON file to determine
6363

6464
Loading application configuration at executable build time can speed up application startup.
6565

66-
### Related Documentation
67-
68-
- [Build-Time Initialization](https://www.graalvm.org/latest/reference-manual/native-image/optimizations-and-performance/ClassInitialization/)
69-
- [Initialize Once, Start Fast: Application Initialization at Build Time](http://www.christianwimmer.at/Publications/Wimmer19a/Wimmer19a.pdf)
66+
Learn more about [Class Initialization in Native Image](https://www.graalvm.org/latest/reference-manual/native-image/optimizations-and-performance/ClassInitialization/) at the website, and from the blog post [Understanding Class Initialization in GraalVM Native Image Generation](https://medium.com/graalvm/understanding-class-initialization-in-graalvm-native-image-generation-d765b7e4d6ed).

native-image-configure-examples/configure-at-buildtime-example/pom.xml renamed to archive/class-initialization-examples/configure-at-buildtime-example/pom.xml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
<properties>
1212
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
13-
<native.maven.plugin.version>0.10.2</native.maven.plugin.version>
13+
<native.maven.plugin.version>0.10.4</native.maven.plugin.version>
1414
<jackson.version>2.16.0</jackson.version>
1515
</properties>
1616

@@ -83,9 +83,6 @@
8383
<configuration>
8484
<skip>false</skip>
8585
<imageName>buildtime-example</imageName>
86-
<buildArgs>
87-
--no-fallback
88-
</buildArgs>
8986
</configuration>
9087
</plugin>
9188
</plugins>

0 commit comments

Comments
 (0)