Skip to content

Latest commit

 

History

23 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jsonata4java-benchmark

Minimal Benchmarking of IBM JSONata4Java vs doing the same work in native Java.

This benchmark is implemented using Java Microbenchmark Harness (JMH)

Run the benchmark

Requires a JDK and Maven. From the repository root:

mvn -q test

See pom.xml and src/main/java/io/github/dhi13man/JsonataBenchmarkingRunner.java. Results from the 2023-12-15 run are under reports/.

Latest Run (2023-12-15T20:00:00Z IST) Results

img.png

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.

Contributing

See CONTRIBUTING.md.

License

See LICENSE.

About

Minimal Benchmarking using Java Microbenchmark Harness (JMH), of IBM JSONata4Java vs doing the same work in native java.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages