Skip to content

Commit 983542f

Browse files
authored
Merge pull request #309 from graalvm/ni-demos-refactoring-6
[GR-60094] Move Optimize a Native Executable with PGO demo to native-image dir.
2 parents a3cfd7d + f90e752 commit 983542f

File tree

8 files changed

+42
-149
lines changed

8 files changed

+42
-149
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: native-image/optimize-with-pgo
2+
on:
3+
push:
4+
paths:
5+
- 'native-image/optimize-with-pgo/**'
6+
- '.github/workflows/native-image-optimize-with-pgo.yml'
7+
pull_request:
8+
paths:
9+
- 'native-image/optimize-with-pgo/**'
10+
- '.github/workflows/native-image-optimize-with-pgo.yml'
11+
schedule:
12+
- cron: "0 0 1 * *" # run every month
13+
workflow_dispatch:
14+
permissions:
15+
contents: read
16+
jobs:
17+
run:
18+
name: Run 'native-image/optimize-with-pgo'
19+
runs-on: ubuntu-latest
20+
timeout-minutes: 15
21+
strategy:
22+
matrix:
23+
java-version: ['21', '24-ea']
24+
steps:
25+
- uses: actions/checkout@v4
26+
- uses: graalvm/setup-graalvm@v1
27+
with:
28+
java-version: ${{ matrix.java-version }}
29+
distribution: 'graalvm'
30+
github-token: ${{ secrets.GITHUB_TOKEN }}
31+
native-image-job-reports: 'true'
32+
- name: Run 'native-image/optimize-with-pgo'
33+
run: |
34+
cd native-image/optimize-with-pgo
35+
./run.sh

.github/workflows/streams.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@ cd graalvm-demos
4747
<td align="left" width="30%"><a href="/java-simple-stream-benchmark/">java-simple-stream-benchmark</a><br><a href="https://github.com/graalvm/graalvm-demos/actions/workflows/java-simple-stream-benchmark.yml"><img alt="java-simple-stream-benchmark" src="https://github.com/graalvm/graalvm-demos/actions/workflows/java-simple-stream-benchmark.yml/badge.svg" /></a></td>
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>
50-
<tr>
51-
<td align="left" width="30%"><a href="/streams/">streams</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 GraalVM efficiently optimizes the Java Streams API application and how to apply PGO<br><strong>Technologies: </strong>Native Image, Native Build Tools Maven Plugin <br><strong>Reference: </strong><a href="https://www.graalvm.org/latest/reference-manual/native-image/guides/optimize-native-executable-with-pgo/">Optimize a Native Executable with Profile-Guided Optimizations</a></td>
53-
</tr>
5450
<tr>
5551
<td align="left" width="30%"><a href="/fortune-demo/">fortune-demo</a><br><a href="https://github.com/graalvm/graalvm-demos/actions/workflows/fortune-demo.yml"><img alt="fortune-demo" src="https://github.com/graalvm/graalvm-demos/actions/workflows/fortune-demo.yml/badge.svg" /></a></td>
5652
<td align="left" width="70%">A fortune teller Unix program. Build a native executable using Gradle or Maven Native Image plugins.<br><strong>Technologies: </strong>Native Image, Native Build Tools Maven plugin <br><strong>Reference: </strong><a href="https://graalvm.github.io/native-build-tools/latest/maven-plugin-quickstart.html">Getting Started with Maven Plugin for GraalVM Native Image</a></td>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.class
2+
streams
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Optimize a Native Executable with Profile-Guided Optimization
2+
3+
You can find the steps to run this demo on [the website](https://www.graalvm.org/latest/reference-manual/native-image/guides/optimize-native-executable-with-pgo/).
File renamed without changes.

streams/run.sh renamed to native-image/optimize-with-pgo/run.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ set -ex
33

44
javac Streams.java
55
java Streams 100000 200
6-
$JAVA_HOME/bin/native-image --pgo-instrument Streams
6+
native-image -Ob --pgo-instrument Streams
77
./streams 100000 200
8-
$JAVA_HOME/bin/native-image --pgo Streams
8+
native-image -Ob --pgo Streams
99
./streams 100000 200

streams/README.md

Lines changed: 0 additions & 114 deletions
This file was deleted.

0 commit comments

Comments
 (0)