Skip to content

Commit fe2cf29

Browse files
committed
Update command options to use Oracle GraalVM + update timing results
1 parent 0ad7159 commit fe2cf29

File tree

1 file changed

+38
-38
lines changed

1 file changed

+38
-38
lines changed

jsoniter-scala-examples/README.md

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Here you will learn how to build and run the simplest example and measure the startup time on Linux using
66
Debian packages
77

8-
### Build uber jar, print its size, and measure its start up time
8+
### Build uber jar, print its size, and measure its start up time (tested with Oracle GraalVM 24-dev)
99

1010
```sh
1111
sudo apt install linux-tools-common linux-tools-generic
@@ -18,20 +18,20 @@ Expected output:
1818
```text
1919
Performance counter stats for './example01.jar' (100 runs):
2020
21-
175.84 msec task-clock # 1.593 CPUs utilized ( +- 0.21% )
22-
1,100 context-switches # 6.256 K/sec ( +- 0.83% )
23-
11 cpu-migrations # 62.556 /sec ( +- 2.06% )
24-
10,057 page-faults # 57.193 K/sec ( +- 0.04% )
25-
720,474,662 cycles # 4.097 GHz ( +- 0.17% )
26-
946,247,562 instructions # 1.31 insn per cycle ( +- 0.07% )
27-
183,694,120 branches # 1.045 G/sec ( +- 0.07% )
28-
7,111,513 branch-misses # 3.87% of all branches ( +- 0.08% )
29-
TopdownL1 # 13.9 % tma_backend_bound
30-
# 33.9 % tma_bad_speculation
31-
# 31.5 % tma_frontend_bound
32-
# 20.8 % tma_retiring ( +- 0.12% )
21+
275.05 msec task-clock # 2.067 CPUs utilized ( +- 0.19% )
22+
1,970 context-switches # 7.162 K/sec ( +- 0.48% )
23+
15 cpu-migrations # 54.536 /sec ( +- 2.23% )
24+
22,159 page-faults # 80.565 K/sec ( +- 0.20% )
25+
1,101,372,203 cycles # 4.004 GHz ( +- 0.20% )
26+
1,504,873,660 instructions # 1.37 insn per cycle ( +- 0.10% )
27+
297,952,673 branches # 1.083 G/sec ( +- 0.10% )
28+
9,110,277 branch-misses # 3.06% of all branches ( +- 0.11% )
29+
TopdownL1 # 14.1 % tma_backend_bound
30+
# 35.6 % tma_bad_speculation
31+
# 30.0 % tma_frontend_bound
32+
# 20.3 % tma_retiring ( +- 0.13% )
3333
34-
0.110362 +- 0.000163 seconds time elapsed ( +- 0.15% )
34+
0.133067 +- 0.000190 seconds time elapsed ( +- 0.14% )
3535
```
3636

3737
### Build Scala JS output, print its size, and measure its start up time with `node`
@@ -102,28 +102,28 @@ Expected output:
102102
```sh
103103
sudo apt install linux-tools-common linux-tools-generic gcc zlib1g-dev
104104
sudo sysctl kernel.perf_event_paranoid=1
105-
scala-cli --power package --graalvm-jvm-id graalvm-java23:23.0.0 --native-image example01.sc --force -o example01_graalvm.bin -- --no-fallback -Os
105+
scala-cli --power package --graalvm-jvm-id graalvm-oracle:23 --native-image example01.sc --force -o example01_graalvm.bin -- --no-fallback -O3
106106
ls -l ./example01_graalvm.bin
107107
perf stat -r 100 ./example01_graalvm.bin > /dev/null
108108
```
109109
Expected output:
110110
```text
111111
Performance counter stats for './example01_graalvm.bin' (100 runs):
112112
113-
2.02 msec task-clock # 0.945 CPUs utilized ( +- 0.49% )
114-
1 context-switches # 493.912 /sec ( +- 8.42% )
113+
1.84 msec task-clock # 0.939 CPUs utilized ( +- 0.40% )
114+
1 context-switches # 542.721 /sec ( +- 3.21% )
115115
0 cpu-migrations # 0.000 /sec
116-
706 page-faults # 348.702 K/sec ( +- 0.01% )
117-
8,343,057 cycles # 4.121 GHz ( +- 0.57% )
118-
11,631,591 instructions # 1.39 insn per cycle ( +- 0.04% )
119-
2,267,207 branches # 1.120 G/sec ( +- 0.03% )
120-
22,802 branch-misses # 1.01% of all branches ( +- 0.78% )
121-
TopdownL1 # 34.0 % tma_backend_bound
122-
# 6.4 % tma_bad_speculation
123-
# 29.4 % tma_frontend_bound
124-
# 30.2 % tma_retiring ( +- 0.57% )
116+
633 page-faults # 343.543 K/sec ( +- 0.01% )
117+
7,594,064 cycles # 4.121 GHz ( +- 0.49% )
118+
11,150,492 instructions # 1.47 insn per cycle ( +- 0.04% )
119+
2,133,178 branches # 1.158 G/sec ( +- 0.03% )
120+
21,759 branch-misses # 1.02% of all branches ( +- 0.84% )
121+
TopdownL1 # 32.0 % tma_backend_bound
122+
# 6.5 % tma_bad_speculation
123+
# 30.0 % tma_frontend_bound
124+
# 31.5 % tma_retiring ( +- 0.49% )
125125
126-
0.0021429 +- 0.0000126 seconds time elapsed ( +- 0.59% )
126+
0.00196304 +- 0.00000988 seconds time elapsed ( +- 0.50% )
127127
```
128128

129129
### Build Scala Native image, print its size, and measure its start up time
@@ -184,7 +184,7 @@ Here is an example of expected output:
184184
Timing buffered disk reads: 2180 MB in 3.04 seconds = 716.07 MB/sec
185185
```
186186

187-
### Build uber jar, print its size, and measure its running time (tested with Oracle Graal VM 24-dev)
187+
### Build uber jar, print its size, and measure its running time (tested with Oracle GraalVM 24-dev)
188188

189189
```sh
190190
scala-cli --power package --assembly example02.sc --force -o example02.jar
@@ -193,23 +193,23 @@ time ./example02.jar -J-XX:+UnlockExperimentalVMOptions -J-XX:+UseEpsilonGC -J-X
193193
```
194194
Expected output:
195195
```text
196-
real 1m2,667s
197-
user 0m59,750s
198-
sys 0m3,171s
196+
real 1m8.991s
197+
user 1m5.239s
198+
sys 0m4.102s
199199
```
200200

201201
### Build GraalVM native image, print its size, and measure its running time
202202

203203
```sh
204-
scala-cli --power package --graalvm-jvm-id graalvm-java23:23.0.0 --native-image example02.sc --force -o example02_graalvm.bin -- --no-fallback --gc=epsilon -Os
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
205205
ls -l ./example02_graalvm.bin
206206
time ./example02_graalvm.bin < 2023_06_430_65B0_in_network_rates.json 2> /dev/null
207207
```
208208
Expected output:
209209
```text
210-
real 1m45,502s
211-
user 1m42,411s
212-
sys 0m3,088s
210+
real 1m34.353s
211+
user 1m29.199s
212+
sys 0m5.151s
213213
```
214214

215215
### Build Scala Native image, print its size, and measure its running time
@@ -221,7 +221,7 @@ time ./example02_native.bin < 2023_06_430_65B0_in_network_rates.json 2> /dev/nul
221221
```
222222
Expected output:
223223
```text
224-
real 1m25,617s
225-
user 1m22,498s
226-
sys 0m3,116s
224+
real 1m27.275s
225+
user 1m23.233s
226+
sys 0m4.038s
227227
```

0 commit comments

Comments
 (0)