simdjson / simdjson-java

A Java version of simdjson, a high-performance JSON parser utilizing SIMD instructions
Apache License 2.0
288 stars 22 forks source link

Update benchmark dependencies #31

Closed plokhotnyuk closed 1 year ago

plokhotnyuk commented 1 year ago

Results on Intel® Core™ i7-11800H CPU @ 2.3GHz (max 4.6GHz), RAM 64Gb DDR4-3200, Ubuntu 23.10 (Linux 6.6.1) with JDK 21 (Java HotSpot(TM) 64-Bit Server VM, 21+35-LTS-2513):

Benchmark                                                                   Mode  Cnt     Score     Error  Units
ParseAndSelectBenchmark.countUniqueUsersWithDefaultProfile_fastjson        thrpt    5   914.874 ±  42.911  ops/s
ParseAndSelectBenchmark.countUniqueUsersWithDefaultProfile_jackson         thrpt    5   816.881 ±  14.097  ops/s
ParseAndSelectBenchmark.countUniqueUsersWithDefaultProfile_jsoniter        thrpt    5   527.052 ±  66.106  ops/s
ParseAndSelectBenchmark.countUniqueUsersWithDefaultProfile_jsoniter_scala  thrpt    5  2476.427 ±  42.218  ops/s
ParseAndSelectBenchmark.countUniqueUsersWithDefaultProfile_simdjson        thrpt    5  2382.208 ±  16.461  ops/s
ParseAndSelectBenchmark.countUniqueUsersWithDefaultProfile_simdjsonPadded  thrpt    5  2472.811 ± 111.562  ops/s
piotrrzysko commented 1 year ago

Thanks!

plokhotnyuk commented 1 year ago

@piotrrzysko I've relaunched benchmarks on the same environment after merged https://github.com/simdjson/simdjson-java/pull/13 and got following results:

Benchmark                                                                   Mode  Cnt     Score    Error  Units
ParseAndSelectBenchmark.countUniqueUsersWithDefaultProfile_fastjson        thrpt    5   931.609 ± 59.739  ops/s
ParseAndSelectBenchmark.countUniqueUsersWithDefaultProfile_jackson         thrpt    5   833.133 ± 29.339  ops/s
ParseAndSelectBenchmark.countUniqueUsersWithDefaultProfile_jsoniter        thrpt    5   549.024 ± 39.648  ops/s
ParseAndSelectBenchmark.countUniqueUsersWithDefaultProfile_jsoniter_scala  thrpt    5  2448.460 ± 41.755  ops/s
ParseAndSelectBenchmark.countUniqueUsersWithDefaultProfile_simdjson        thrpt    5  1060.051 ± 31.904  ops/s
ParseAndSelectBenchmark.countUniqueUsersWithDefaultProfile_simdjsonPadded  thrpt    5  1078.887 ± 23.682  ops/s

Would it be possible to turn off UTF-8 validation optionally?

piotrrzysko commented 1 year ago

I'm planning to add such an option. However, I believe validation should be enabled by default. I'm currently exploring other options to improve the performance, such as the on-demand API available in the C++ version of simdjson, along with support for 512-bit vectors in the utf-8 validator.

piotrrzysko commented 1 year ago

BTW, would you mind running the same benchmark from this branch: https://github.com/simdjson/simdjson-java/tree/utf8-experiments? This branch introduces support for 512-bit vectors, and if I'm not mistaken, your CPU supports AVX-512 instructions.

plokhotnyuk commented 1 year ago

Here are results from the current state of utf8-experiments branch (I wasn't able to rebase it over the current main due to a lot of conflicts):

Benchmark                                                                   Mode  Cnt     Score    Error  Units
ParseAndSelectBenchmark.countUniqueUsersWithDefaultProfile_fastjson        thrpt    5   926.479 ± 85.427  ops/s
ParseAndSelectBenchmark.countUniqueUsersWithDefaultProfile_jackson         thrpt    5   843.090 ± 26.506  ops/s
ParseAndSelectBenchmark.countUniqueUsersWithDefaultProfile_jsoniter        thrpt    5   539.741 ± 59.262  ops/s
ParseAndSelectBenchmark.countUniqueUsersWithDefaultProfile_jsoniter_scala  thrpt    5  2472.701 ± 17.107  ops/s
ParseAndSelectBenchmark.countUniqueUsersWithDefaultProfile_simdjson        thrpt    5  2264.005 ± 28.860  ops/s
ParseAndSelectBenchmark.countUniqueUsersWithDefaultProfile_simdjsonPadded  thrpt    5  2392.960 ± 45.448  ops/s
piotrrzysko commented 1 year ago

Thanks.