0.2.0
Updates of dependencies
Kotlin 1.1.51.
Performance improvements
Tournament tree atop the queue is backed by a twice smaller array. Thus entire PriorityQueue
memory consumption is reduces by 25% improving data cache performance. According to benchmarks, for random input and for all operations keap-based PriorityQueue
performs better than java.util.PriorityQueue
.
Benchmarks results
Building the queue from collections of random elements:
Benchmark Mode Cnt Score Error Units
JavaQueueRandomBenchmark.heapify thrpt 20 1.827 ± 0.031 ops/ms
KeapQueueRandomBenchmark.heapify thrpt 20 3.498 ± 0.017 ops/ms
Basic queue operations with random elements:
Benchmark Mode Cnt Score Error Units
JavaQueueRandomBenchmark.offer thrpt 20 3.728 ± 0.038 ops/us
JavaQueueRandomBenchmark.peek thrpt 20 80.269 ± 0.713 ops/us
JavaQueueRandomBenchmark.poll thrpt 20 4.273 ± 0.088 ops/us
KeapQueueRandomBenchmark.offer thrpt 20 4.083 ± 0.039 ops/us
KeapQueueRandomBenchmark.peek thrpt 20 84.329 ± 0.572 ops/us
KeapQueueRandomBenchmark.poll thrpt 20 11.019 ± 0.475 ops/us
Offering ordered elements:
Benchmark Mode Cnt Score Error Units
JavaQueueOrderedBenchmark.offerDecreasing thrpt 20 5.458 ± 0.075 ops/us
JavaQueueOrderedBenchmark.offerIncreasing thrpt 20 30.762 ± 0.527 ops/us
KeapQueueOrderedBenchmark.offerDecreasing thrpt 20 8.177 ± 0.121 ops/us
KeapQueueOrderedBenchmark.offerIncreasing thrpt 20 8.467 ± 0.217 ops/us