Skip to content

Latest commit

 

History

History
51 lines (35 loc) · 2.65 KB

README.md

File metadata and controls

51 lines (35 loc) · 2.65 KB

Json-LD Benchmark Java implementations

A benchmark of the following JSON-LD implementations:

The benchmarks use a subset of W3C compliance test suite for JSON-LD 1.1. In order to compare the 2 implementations, we need the subset of test entries which pass in both implementations. Because of the low ow coverage for Json-LD Java on Json-LD 1.1 spec this subset is sometimes small.

Running the benchmarks

The default parameters are: 5 JVM warmup iterations and 10 measurement iterations:

sbt jmh:run

You can tweak the warmup iterations and the measurament iteration parameters:

sbt jmh:run -iw {warmup_iterations_number} -i {measurement_iterations_number}

Updating the test suite

The test suite can be found as a compress bundle in src/test/resources/json-ld-11.org.tgz from the original W3C compliance test suite. However, tests can be updated (in case W3C modifies them) using the following command (Mac OS and Linux):

bash download_suite.sh

Results

The provided results are the ratio between the throughput obtained by Json-LD Java implementation / the one obtained by Titanium.

Number of tests Ratio (Json-LD Java / Titanium)
compact 89 7.62
expand 83 7.34
flatten 45 10.60
frame 42 17.13
fromRdf 30 5.73
toRdf 127 11.05
Total 416 9.911

from the benchmark results the Json-LD Java implementation is 10 times faster in average than Titanium.

This difference in performance can be caused by the greater complexity of the different algorithms in Json-LD 1.1 due to the introduction of many new features.

The fact that Titanium is a very recent library (at the time of writing, 03.12.2020) can also explain part of the difference in benchmark results, compared to a mature Json-LD Java.