Skip to content

Commit 4dc7374

Browse files
committed
More efficient JSON validation with smaller buffers
1 parent 0ffb1f0 commit 4dc7374

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

jsoniter-scala-examples/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ No GC options are used to speed up JSON validation for all supported builds.
137137
```sh
138138
scala-cli --power package --assembly example02.sc --force -o example02.jar
139139
ls -l ./example02.jar
140-
time ./example02.jar -J-XX:+UnlockExperimentalVMOptions -J-XX:+UseEpsilonGC -J-Xms16m -J-Xmx16m -J-XX:+AlwaysPreTouch < test.json 2> /dev/null
140+
time ./example02.jar -J-XX:+UnlockExperimentalVMOptions -J-XX:+UseEpsilonGC -J-Xms8m -J-Xmx8m -J-XX:+AlwaysPreTouch < test.json 2> /dev/null
141141
```
142142
Expected output:
143143
```text

jsoniter-scala-examples/example02.sc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ val jsonCodec: JsonValueCodec[Unit] = new JsonValueCodec[Unit] {
4747
}
4848
}
4949

50-
val config = ReaderConfig.withPreferredBufSize(1024 * 1024).withPreferredCharBufSize(1024 * 1024)
51-
try readFromStream(System.in, config)(jsonCodec) catch {
50+
try readFromStream(System.in)(jsonCodec) catch {
5251
case ex: Throwable => ex.printStackTrace(System.err)
5352
}

0 commit comments

Comments
 (0)