https://github.com/dhi13man/jsonata4java-benchmark
Minimal Benchmarking using Java Microbenchmark Harness (JMH), of IBM JSONata4Java vs doing the same work in native java.
https://github.com/dhi13man/jsonata4java-benchmark
analytics benchmark java jmh json jsonata
Last synced: about 2 months ago
JSON representation
Minimal Benchmarking using Java Microbenchmark Harness (JMH), of IBM JSONata4Java vs doing the same work in native java.
- Host: GitHub
- URL: https://github.com/dhi13man/jsonata4java-benchmark
- Owner: Dhi13man
- License: mit
- Created: 2023-12-11T07:48:50.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-16T16:07:30.000Z (over 2 years ago)
- Last Synced: 2025-06-07T17:43:14.632Z (about 1 year ago)
- Topics: analytics, benchmark, java, jmh, json, jsonata
- Language: Java
- Homepage: https://medium.com/@dhi13man/benchmarking-ibms-jsonata4java-using-java-microbenchmark-harness-jmh-2e2f7543ecbd
- Size: 386 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# jsonata4java-benchmark
Minimal Benchmarking of [IBM JSONata4Java](https://github.com/IBM/JSONata4Java) vs doing the same
work in native Java.
This benchmark is implemented
using [Java Microbenchmark Harness (JMH)](https://github.com/openjdk/jmh)
## Latest Run (2023-12-15T20:00:00Z IST) Results
[](https://github.com/Dhi13man/jsonata4java-benchmark/blob/218dd4403842fecb80a0713c1a80c83396089eb9/reports/2023-12-15T20%3A00%3A00Z/native_vs_jsonata_vs_jsonata_precompiled.txt)
### Test ran
The aim was to calculate the average operation time and throughput.
- Ran three types of transformations (SIMPLE / COMPLEX / JOIN)
- Ran using 3 JVM Warmup Process and 5 Evaluated JVM Processes
- Each process runs 5 Warmup iterations and 5 Evaluated iterations
- Each iteration runs as many operations as possible for 10 seconds
Total Benchmarking Duration: 4 Hours 08 Minutes 39 Seconds
### Key Findings
As per the benchmarking results,
1. logic implemented natively in Java is between 2 and 3 orders of magnitude faster than
the same logic implemented in JSONata.
2. JSONata precompiled implementation is up to 1 order of magnitude faster than the
compiled-at-runtime JSONata implementation.
3. JSONata's implementation code is much more repeatable and flexible than the native
implementation.
### Summary
Despite JSONata seeming much slower than native implementation, most systems are not going to be
doing this order of magnitude of processing anyway. So, the JSONata implementation is a good choice
for most systems, because of its flexibility.
Further, pre-compiling the JSONata expressions in Java could lead to performance improvements, even
if not as much as native implementation.