RDF4J benchmarks
The following results were obtained by benchmarking Jelly-JVM against the N-Triples/N-Quads and RDF4J Binary serializations built into RDF4J.
The benchmarks were performed on two kinds of RDF streams (according to the RDF-STaX taxonomy):
- Flat RDF streams – streams of RDF triples or quads. This is the "classic" serialization – equivalent to, for example N-Triples or N-Quads.
- Grouped RDF streams – streams of RDF graphs or datasets.
Jelly has a major performance advantage especially in grouped RDF streams. This is mostly due to Jelly being the only tested serialization that natively supports grouped RDF streams. Because of this, Jelly can exploit the repeating terms, prefixes, and structures in the stream to achieve much better compression and serialization speed.
If you are only interested in parsing/writing a single graph or dataset, look at the flat streaming results.
Benchmark setup
The same methodology was used as in the Apache Jena benchmarks, with the same datasets and the same setup. The benchmark was performed with Jelly-JVM 2.2.2 and RDF4J 5.0.2.
Results
Apache Jena performance results
This page only shows supplementary performance results for RDF4J. More benchmarks (including the serialized representation size) with Jena can be found here: Apache Jena performance.
Warning
These results are NOT directly comparable with the performance results obtained on Jena. The two libraries have different APIs and internal data structures, which does affect the performance.
The results can only be used to compare the performance within RDF4J.
Flat streaming serialization throughput
- RiverBench task:
flat-serialization-throughput
(2.1.0) - RiverBench profile:
flat-mixed-rdfstar
(2.1.0) - The first 5,000,000 statements of each dataset were used for this benchmark.
- Each method/dataset combination was run 15 times, the first 5 runs were discarded to account for JVM warmup, and the remaining 10 runs were averaged.
- The data was preloaded into memory and serialized to a null output stream.
Flat streaming serialization is admittedly the one scenario where Jelly is pretty close to RDF4J Binary in terms of performance. RDF4J Binary is very effective at serializing big batches of RDF triples/quads, because it maintains a large buffer of statements that wait in a queue before being serialized. This does result in very good throughput, but it also hurts the latency (which is in some cases relevant) and makes it less effective for smaller batches of statements. Jelly can universally fit both use cases – see the results for grouped streams below.
Flat streaming deserialization throughput
- RiverBench task:
flat-deserialization-throughput
(2.1.0) - RiverBench profile:
flat-mixed-rdfstar
(2.1.0) - The first 5,000,000 statements of each dataset were used for this benchmark.
- Each method/dataset combination was run 15 times, the first 5 runs were discarded to account for JVM warmup, and the remaining 10 runs were averaged.
- Before running the benchmark, the data was serialized to a single byte array and then deserialized from it. The deserializer was emitting only a stream of triples/quads, without any further processing.
Grouped streaming serialization throughput
- RiverBench task:
stream-serialization-throughput
(2.1.0) - RiverBench profile:
stream-mixed-rdfstar
(2.1.0) - The first 100,000 stream elements of each dataset were used for this benchmark.
- Each method/dataset combination was run 15 times, the first 5 runs were discarded to account for JVM warmup, and the remaining 10 runs were averaged.
- The data was preloaded into memory and serialized to a null output stream.
Grouped streaming deserialization throughput
- RiverBench task:
stream-deserialization-throughput
(2.1.0) - RiverBench profile:
stream-mixed-rdfstar
(2.1.0) - The first 100,000 stream elements of each dataset were used for this benchmark.
- Each method/dataset combination was run 15 times, the first 5 runs were discarded to account for JVM warmup, and the remaining 10 runs were averaged.
- Before running the benchmark, the data was serialized to a list of byte arrays (one array per stream element) and then deserialized from it. The deserializer was emitting only a stream of triples/quads, without any further processing.
See also
- Benchmarks with Jena
- Benchmark code
- RiverBench benchmark suite
- Jelly-JVM – the Jelly implementation used in the benchmarks
- User guide