@@ -180,8 +180,8 @@ sudo hdparm -Tt /dev/nvme0n1p4
180
180
Here is an example of expected output:
181
181
``` text
182
182
/dev/nvme0n1p4:
183
- Timing cached reads: 48588 MB in 2.00 seconds = 24334.91 MB/sec
184
- Timing buffered disk reads: 4456 MB in 3.00 seconds = 1485.08 MB/sec
183
+ Timing cached reads: 50804 MB in 2.00 seconds = 25445.50 MB/sec
184
+ Timing buffered disk reads: 8678 MB in 3.00 seconds = 2892.53 MB/sec
185
185
```
186
186
187
187
### Build uber jar, print its size, and measure its running time (tested with Oracle GraalVM 25-dev)
@@ -193,61 +193,35 @@ time ./example02.jar -J-XX:+UnlockExperimentalVMOptions -J-XX:+UseEpsilonGC -J-X
193
193
```
194
194
Expected output:
195
195
``` text
196
- real 0m37.615s
197
- user 0m35.187s
198
- sys 0m2.662s
196
+ real 0m36.840s
197
+ user 0m34.748s
198
+ sys 0m2.362s
199
199
```
200
200
201
- ### Build GraalVM native image, print its size, and measure its running time (tested with Oracle GraalVM 23)
201
+ ### Build GraalVM native image, print its size, and measure its running time (tested with Oracle GraalVM 24/ 23)
202
202
203
203
``` sh
204
- scala-cli --power package --graalvm-jvm-id graalvm-oracle:23 --native-image example02.sc --force -o example02_graalvm.bin -- --no-fallback --gc=epsilon -O3 -H:+UnlockExperimentalVMOptions -R:MaxHeapSize=16m -H:-GenLoopSafepoints -H:-ParseRuntimeOptions -H:-IncludeMethodData --initialize-at-build-time
204
+ scala-cli --power package --graalvm-jvm-id graalvm-oracle:24 --native-image example02.sc --force -o example02_graalvm.bin -- --no-fallback --gc=epsilon -O3 -H:+UnlockExperimentalVMOptions -R:MaxHeapSize=16m -H:-GenLoopSafepoints -H:-ParseRuntimeOptions -H:-IncludeMethodData --initialize-at-build-time
205
205
ls -l ./example02_graalvm.bin
206
206
time ./example02_graalvm.bin < 2023_06_430_65B0_in_network_rates.json 2> /dev/null
207
207
```
208
208
Expected output:
209
209
``` text
210
- real 0m44.963s
211
- user 0m42.471s
212
- sys 0m2.486s
213
- ```
214
-
215
- You can use profile guided optimization (PGO) to improve performance of Oracle GraalVM native image, for that you need:
216
- - build an instrumented GraalVM native image with ` --pgo-instrument ` option added:
217
- ``` sh
218
- scala-cli --power package --graalvm-jvm-id graalvm-oracle:23 --native-image example02.sc --force -o example02_graalvm_instrumented.bin -- --no-fallback --gc=epsilon -O3 --pgo-instrument -H:+UnlockExperimentalVMOptions -R:MaxHeapSize=16m -H:-GenLoopSafepoints -H:-ParseRuntimeOptions -H:-IncludeMethodData --initialize-at-build-time
219
- ls -l ./example02_graalvm_instrumented.bin
220
- ```
221
- - run the instrumented image and collect the profile data:
222
- ``` sh
223
- time ./example02_graalvm_instrumented.bin < 2023_06_430_65B0_in_network_rates.json 2> /dev/null
224
- ```
225
- - build a PGO-optimized GraalVM native image with ` --pgo=default.iprof ` option added:
226
- ``` sh
227
- scala-cli --power package --graalvm-jvm-id graalvm-oracle:23 --native-image example02.sc --force -o example02_graalvm_optimized.bin -- --no-fallback --gc=epsilon -O3 --pgo=default.iprof -H:+UnlockExperimentalVMOptions -R:MaxHeapSize=16m -H:-GenLoopSafepoints -H:-ParseRuntimeOptions -H:-IncludeMethodData --initialize-at-build-time
228
- ls -l ./example02_graalvm_optimized.bin
229
- ```
230
- - run the PGO-optimized image:
231
- ``` sh
232
- time ./example02_graalvm_optimized.bin < 2023_06_430_65B0_in_network_rates.json 2> /dev/null
233
- ```
234
- Expected output:
235
- ``` text
236
- real 0m43.674s
237
- user 0m41.213s
238
- sys 0m2.461s
210
+ real 0m45.922s
211
+ user 0m43.495s
212
+ sys 0m2.424s
239
213
```
240
214
241
215
### Build Scala Native image, print its size, and measure its running time
242
216
243
217
``` sh
244
- scala-cli --power package --native-version 0.5.7 --native example02.sc --native-mode release-full --native-gc none --native-lto thin --native-multithreading=false --force -o example02_native.bin
218
+ scala-cli --power package --native-version 0.5.8 --native example02.sc --native-mode release-full --native-gc none --native-lto thin --native-multithreading=false --force -o example02_native.bin
245
219
ls -l ./example02_native.bin
246
220
time ./example02_native.bin < 2023_06_430_65B0_in_network_rates.json 2> /dev/null
247
221
```
248
222
Expected output:
249
223
``` text
250
- real 0m49.232s
251
- user 0m46.838s
252
- sys 0m2.389s
224
+ real 0m49.766s
225
+ user 0m47.408s
226
+ sys 0m2.355s
253
227
```
0 commit comments