@@ -128,26 +128,30 @@ Expected output:
128
128
An example of a command line application that reads the system input, parses and validates JSON according to the latest
129
129
specification and in case of any error prints it to the system error output.
130
130
131
+ Scala.js build is missing because it doesn't support reading from the system input.
132
+
133
+ No GC options are used to speed up JSON validation for all supported builds.
134
+
131
135
### Build uber jar, print its size, and measure its start up time
132
136
133
137
``` sh
134
138
scala-cli --power package --assembly example02.sc --force -o example02.jar
135
139
ls -l ./example02.jar
136
- time ./example02.jar < test.json 2> /dev/null
140
+ time ./example02.jar -J-XX:+UnlockExperimentalVMOptions -J-XX:+UseEpsilonGC -J-Xms16m -J-Xmx16m -J-XX:+AlwaysPreTouch < test.json 2> /dev/null
137
141
```
138
142
Expected output:
139
143
``` text
140
- real 0m0.087s
141
- user 0m0.112s
142
- sys 0m0.022s
144
+ real 0m0.085s
145
+ user 0m0.110s
146
+ sys 0m0.017s
143
147
```
144
148
145
149
### Build GraalVM native image, print its size, and measure its start up time
146
150
147
151
``` sh
148
- scala-cli --power package --jvm graalvm --native-image example02.sc --force -o example02_graalvm.bin -- --no-fallback
152
+ scala-cli --power package --jvm graalvm --native-image example02.sc --force -o example02_graalvm.bin -- --no-fallback --gc=epsilon
149
153
ls -l ./example02_graalvm.bin
150
- time ./example02_graalvm.bin < test.json 2> /dev/null
154
+ time ./example02_graalvm.bin < test.json 2> /dev/null
151
155
```
152
156
Expected output:
153
157
``` text
@@ -159,13 +163,13 @@ sys 0m0.003s
159
163
### Build Scala Native image, print its size, and measure its start up time
160
164
161
165
``` sh
162
- scala-cli --power package --native-version 0.4.16 --native example02.sc --force -o example02_native.bin
166
+ scala-cli --power package --native-version 0.4.16 --native example02.sc --native-gc none -- force -o example02_native.bin
163
167
ls -l ./example02_native.bin
164
- time ./example02_native.bin < test.json 2> /dev/null
168
+ time ./example02_native.bin < test.json 2> /dev/null
165
169
```
166
170
Expected output:
167
171
``` text
168
- real 0m0.004s
169
- user 0m0.004s
172
+ real 0m0.003s
173
+ user 0m0.003s
170
174
sys 0m0.000s
171
175
```
0 commit comments