
SJF4J vs Jayway JsonPath: Up to 7x Faster in Java Benchmarks
We benchmarked JSONPath in Java. SJF4J: https://github.com/sjf4j-projects/sjf4j Jayway JsonPath: https://github.com/json-path/JsonPath Result: SJF4J is up to 7x faster. Here’s what we found. Benchmark Setup We built a JMH benchmark suite comparing: SJF4J Jayway JsonPath Across three workload shapes: Path compilation Query on shared JsonNode Query on Map/List object graphs JMH config: 5 × 300ms warmup 8 × 300ms measurement 2 forks 1 thread Expressions used: $.store.book[1].price $.store.bicycle.color $.store.book[*].author $..price $.store.book[?(@.price > 10)].title $.store.book[0,2].title Headline Results Geometric mean (lower is better): Benchmark group SJF4J Jayway Result compile 97 ns/op 125 ns/op SJF4J 1.28x faster query_definite 100 ns/op 237 ns/op SJF4J 2.38x faster query_indefinite 656 ns/op 1294 ns/op SJF4J 1.97x faster query_map_list_definite 31 ns/op 200 ns/op SJF4J 6.38x faster query_map_list_indefinite 280 ns/op 1301 ns/op SJF4J 4.65x faster TL;DR ~2x faster on typical que
Continue reading on Dev.to
Opens in a new tab

