Introduction

Here are benchmarking results for «Replacing HashSet with Sorted Array and Binary Search in Java?» blog post.

The performance tests are performed via JMH. The configuration of a hardware is Intel® Core™ i7-1165G7 @ 2.80GHz × 8 (4 core + 4 HT) with 16 GB RAM. Scala version: 2.13.6.

Charts

avg - average, p0 - percentile 0 (min), p50 - percentile 50 (median), p95 - percentile 95, p99 - percentile 99, p100 - percentile 100 (max)

Lookup Performance

Performance of the successful lookup (hit) for all JDKs:

Performance of the failed lookup (miss) for all JDKs:

Performance for different collection size

Off-Heap only, including Composite buffer

Composite buffer was excluded from the previous graphs, because it's extremely slow. Below only off-heap collections:

Full JMH logs:openjdk-8, openjdk-11, openjdk-17.