pairing_heap 0.3.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,8 +1,11 @@
1
1
  # PairingHeap
2
+ [![Ruby Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://github.com/testdouble/standard)
2
3
 
3
4
  PairingHeap is a pure Ruby priority queue implementation using a pairing heap as the underlying data structure. While a pairing heap is asymptotically less efficient than the Fibonacci heap, it is usually faster in practice. This makes it a popular choice for Prim's MST or Dijkstra's algorithm implementations.
4
5
 
5
- Also implementation without priority change support is provided(`SimplePairingHeap`), while the asymptotical complexity of the methods stay the same, bookkeeping of elements is not needed making the constant smaller.
6
+ PairingHeap is currently being used as the priority queue data structure in [RGL](https://github.com/monora/rgl/).
7
+
8
+ Also implementation without priority change support is provided(`SimplePairingHeap`), while the asymptotical complexity of the methods stay the same, bookkeeping of elements is not needed making, the constant smaller.
6
9
 
7
10
  ## Installation
8
11
 
@@ -34,8 +37,8 @@ simple_heap.push(:a, 1)
34
37
  simple_heap.push(:b, 2)
35
38
  simple_heap.push(:c, 3)
36
39
  simple_heap.peek # => :a
37
- simple_heap.peek_priority # => [:a, 1]
38
- simple_heap.pop_priority # => [:a, 1]
40
+ simple_heap.peek_priority # => 1
41
+ simple_heap.pop_with_priority # => [:a, 1]
39
42
  simple_heap.pop # => :b
40
43
 
41
44
  # Min priority queue
@@ -104,7 +107,7 @@ This API is a drop-in replacement of [lazy_priority_queue](https://github.com/ma
104
107
  ## Benchmarks
105
108
  I picked the three fastest pure Ruby priority queue implementations I was aware of for the comparison:
106
109
 
107
- * [lazy_priority_queue](https://github.com/matiasbattocchia/lazy_priority_queue) that uses a lazy binomial heap. This is probably the most popular option, used for example in [RGL](https://github.com/monora/rgl/)
110
+ * [lazy_priority_queue](https://github.com/matiasbattocchia/lazy_priority_queue) that uses a lazy binomial heap. This is probably the most popular option. It was used in [RGL](https://github.com/monora/rgl/) until PairingHeap replaced it.
108
111
  * Pure Ruby implementation of Fibonacci Heap from [priority-queue](https://github.com/supertinou/priority-queue) ([link to source](https://github.com/supertinou/priority-queue/blob/master/lib/priority_queue/ruby_priority_queue.rb))
109
112
  * [rb_heap](https://github.com/florian/rb_heap) that uses a binary heap. Note however that this implementation does not support change_priority operation.
110
113
 
@@ -114,7 +117,7 @@ Original performance test from [lazy_priority_queue](https://github.com/matiasba
114
117
  > A stress test of 1,000,000 operations: starting with 1,000 pushes/0 pops, following 999 pushes/1 pop, and so on till 0 pushes/1000 pops.
115
118
  <table>
116
119
  <tr>
117
- <th colspan="4">ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [x86_64-darwin21]</th>
120
+ <th colspan="4">ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-darwin21]</th>
118
121
  </tr>
119
122
  <tr>
120
123
  <th>Library</th>
@@ -124,36 +127,36 @@ Original performance test from [lazy_priority_queue](https://github.com/matiasba
124
127
  </tr>
125
128
  <tr>
126
129
  <td>pairing_heap (SimplePairingHeap)</td>
127
- <td>18</td>
128
- <td>60.232046</td>
129
- <td>0.299</td>
130
+ <td>23</td>
131
+ <td>62.014773</td>
132
+ <td>0.371</td>
130
133
  </tr>
131
134
  <tr>
132
135
  <td>pairing_heap (PairingHeap)</td>
133
- <td>15</td>
134
- <td>63.978031</td>
135
- <td>0.234(1.27x slower)</td>
136
+ <td>16</td>
137
+ <td>63.135240</td>
138
+ <td>0.253(1.46x slower)</td>
136
139
  </tr>
137
140
  <tr>
138
- <td>lazy_priority_queue</td>
139
- <td>9</td>
140
- <td>60.031283</td>
141
- <td>0.150(1.99x slower)</td>
141
+ <td>rb_heap</td>
142
+ <td>14</td>
143
+ <td>61.123304</td>
144
+ <td>0.229(1.62x slower)</td>
142
145
  </tr>
143
146
  <tr>
144
- <td>rb_heap</td>
145
- <td>9</td>
146
- <td>60.497355</td>
147
- <td>0.149(2.01x slower)</td>
147
+ <td>lazy_priority_queue</td>
148
+ <td>10</td>
149
+ <td>66.208647</td>
150
+ <td>0.151(2.46x slower)</td>
148
151
  </tr>
149
152
  <tr>
150
153
  <td>Fibonacci</td>
151
154
  <td>8</td>
152
- <td>66.866055</td>
153
- <td>0.120(2.50x slower)</td>
155
+ <td>66.353147</td>
156
+ <td>0.121(3.08x slower)</td>
154
157
  </tr>
155
158
  <tr>
156
- <th colspan="4">ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) +YJIT [x86_64-darwin21]</th>
159
+ <th colspan="4">ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) +YJIT [x86_64-darwin21]</th>
157
160
  </tr>
158
161
  <tr>
159
162
  <th>Library</th>
@@ -163,36 +166,36 @@ Original performance test from [lazy_priority_queue](https://github.com/matiasba
163
166
  </tr>
164
167
  <tr>
165
168
  <td>pairing_heap (SimplePairingHeap)</td>
166
- <td>22</td>
167
- <td>62.866807</td>
168
- <td>0.350</td>
169
+ <td>25</td>
170
+ <td>60.423579</td>
171
+ <td>0.414</td>
172
+ </tr>
173
+ <tr>
174
+ <td>rb_heap</td>
175
+ <td>19</td>
176
+ <td>60.869907</td>
177
+ <td>0.312(1.33x slower)</td>
169
178
  </tr>
170
179
  <tr>
171
180
  <td>pairing_heap (PairingHeap)</td>
172
- <td>16</td>
173
- <td>61.358679</td>
174
- <td>0.261(1.34x slower)</td>
181
+ <td>17</td>
182
+ <td>61.389127</td>
183
+ <td>0.277(1.49x slower)</td>
175
184
  </tr>
176
185
  <tr>
177
186
  <td>Fibonacci</td>
178
187
  <td>14</td>
179
- <td>64.394112</td>
180
- <td>0.217(1.61x slower)</td>
181
- </tr>
182
- <tr>
183
- <td>rb_heap</td>
184
- <td>12</td>
185
- <td>60.975479</td>
186
- <td>0.197(1.78x slower)</td>
188
+ <td>64.417807</td>
189
+ <td>0.217(1.90x slower)</td>
187
190
  </tr>
188
191
  <tr>
189
192
  <td>lazy_priority_queue</td>
190
193
  <td>11</td>
191
- <td>65.568648</td>
192
- <td>0.168(2.09x slower)</td>
194
+ <td>63.151856</td>
195
+ <td>0.174(2.38x slower)</td>
193
196
  </tr>
194
197
  <tr>
195
- <th colspan="4">jruby 9.3.3.0 (2.6.8) 2022-01-19 b26de1f5c5 OpenJDK 64-Bit Server VM 16.0.1+9-24 on 16.0.1+9-24 +jit [darwin-x86_64]</th>
198
+ <th colspan="4">jruby 9.3.7.0 (2.6.8) 2022-08-16 c79ef237e0 OpenJDK 64-Bit Server VM 17.0.2+8-86 on 17.0.2+8-86 +indy +jit [x86_64-darwin]</th>
196
199
  </tr>
197
200
  <tr>
198
201
  <th>Library</th>
@@ -202,36 +205,36 @@ Original performance test from [lazy_priority_queue](https://github.com/matiasba
202
205
  </tr>
203
206
  <tr>
204
207
  <td>pairing_heap (SimplePairingHeap)</td>
205
- <td>21</td>
206
- <td>60.357577s</td>
207
- <td>0.348</td>
208
+ <td>47</td>
209
+ <td>60.391633</td>
210
+ <td>0.778</td>
208
211
  </tr>
209
212
  <tr>
210
- <td>pairing_heap (PairingHeap)</td>
211
- <td>15</td>
212
- <td>60.417252</td>
213
- <td>0.248(1.40x slower)</td>
213
+ <td>rb_heap</td>
214
+ <td>34</td>
215
+ <td>60.878639</td>
216
+ <td>0.559(1.39x slower)</td>
214
217
  </tr>
215
218
  <tr>
216
- <td>lazy_priority_queue</td>
217
- <td>14</td>
218
- <td>61.022450</td>
219
- <td>0.229(1.52x slower)</td>
219
+ <td>pairing_heap (PairingHeap)</td>
220
+ <td>32</td>
221
+ <td>61.211985</td>
222
+ <td>0.523(1.49x slower)</td>
220
223
  </tr>
221
224
  <tr>
222
- <td>rb_heap</td>
223
- <td>13</td>
224
- <td>63.661862</td>
225
- <td>0.204(1.70x slower)</td>
225
+ <td>Fibonacci</td>
226
+ <td>23</td>
227
+ <td>60.297670</td>
228
+ <td>0.382(2.04x slower)</td>
226
229
  </tr>
227
230
  <tr>
228
- <td>Fibonacci</td>
229
- <td>8</td>
230
- <td>62.643449</td>
231
- <td>0.128(2.72x slower)</td>
231
+ <td>lazy_priority_queue</td>
232
+ <td>23</td>
233
+ <td>61.973538</td>
234
+ <td>0.371(2.10x slower)</td>
232
235
  </tr>
233
236
  <tr>
234
- <th colspan="4">jruby 9.3.3.0 (2.6.8) 2022-01-19 b26de1f5c5 OpenJDK 64-Bit Server VM 16.0.1+9-24 on 16.0.1+9-24 +indy +jit [darwin-x86_64]</th>
237
+ <th colspan="4">truffleruby 22.2.0, like ruby 3.0.3, GraalVM CE JVM [x86_64-darwin]</th>
235
238
  </tr>
236
239
  <tr>
237
240
  <th>Library</th>
@@ -241,33 +244,33 @@ Original performance test from [lazy_priority_queue](https://github.com/matiasba
241
244
  </tr>
242
245
  <tr>
243
246
  <td>pairing_heap (SimplePairingHeap)</td>
244
- <td>43</td>
245
- <td>60.472129</td>
246
- <td>0.711</td>
247
+ <td>206</td>
248
+ <td>60.191686</td>
249
+ <td>3.433</td>
247
250
  </tr>
248
251
  <tr>
249
- <td>pairing_heap (PairingHeap)</td>
250
- <td>30</td>
251
- <td>60.359748</td>
252
- <td>0.497(1.43x slower)</td>
252
+ <td>rb_heap</td>
253
+ <td>97</td>
254
+ <td>60.134011</td>
255
+ <td>1.614(1.93x slower)</td>
253
256
  </tr>
254
257
  <tr>
255
- <td>Fibonacci</td>
256
- <td>25</td>
257
- <td>62.084250</td>
258
- <td>0.403(1.77x slower)</td>
258
+ <td>pairing_heap (PairingHeap)</td>
259
+ <td>85</td>
260
+ <td>60.193608s</td>
261
+ <td>1.434(2.40x slower)</td>
259
262
  </tr>
260
263
  <tr>
261
- <td>rb_heap</td>
262
- <td>23</td>
263
- <td>62.419893</td>
264
- <td>0.369(1.93x slower)</td>
264
+ <td>lazy_priority_queue</td>
265
+ <td>19</td>
266
+ <td>63.212429</td>
267
+ <td>0.301(11.45x slower)</td>
265
268
  </tr>
266
269
  <tr>
267
- <td>lazy_priority_queue</td>
268
- <td>22</td>
269
- <td>60.947299</td>
270
- <td>0.361(1.97x slower)</td>
270
+ <td>Fibonacci</td>
271
+ <td>2</td>
272
+ <td>83.508571</td>
273
+ <td>0.024(143.70x slower)</td>
271
274
  </tr>
272
275
  </table>
273
276
 
@@ -275,7 +278,7 @@ Original performance test from [lazy_priority_queue](https://github.com/matiasba
275
278
  A stress test of 1,501,500 operations: starting with 1,000 pushes/1000 change_priorities/0 pops, following 999 pushes/999 change_priorities/1 pop, and so on till 0 pushes/0 change_priorities/1000 pops.
276
279
  <table>
277
280
  <tr>
278
- <th colspan="4">ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [x86_64-darwin21]</th>
281
+ <th colspan="4">ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-darwin21]</th>
279
282
  </tr>
280
283
  <tr>
281
284
  <th>Library</th>
@@ -285,24 +288,24 @@ A stress test of 1,501,500 operations: starting with 1,000 pushes/1000 change_pr
285
288
  </tr>
286
289
  <tr>
287
290
  <td>pairing_heap</td>
288
- <td>14</td>
289
- <td>63.536300</td>
290
- <td>0.220</td>
291
+ <td>15</td>
292
+ <td>62.946988</td>
293
+ <td>0.238</td>
291
294
  </tr>
292
295
  <tr>
293
296
  <td>lazy_priority_queue</td>
294
297
  <td>9</td>
295
- <td>63.319474s</td>
296
- <td>0.142(1.55x slower)</td>
298
+ <td>61.876691</td>
299
+ <td>0.145(1.64x slower)</td>
297
300
  </tr>
298
301
  <tr>
299
302
  <td>Fibonacci</td>
300
303
  <td>8</td>
301
- <td>67.385714</td>
302
- <td>0.119(1.86x slower)</td>
304
+ <td>67.809982</td>
305
+ <td>0.118(2.02x slower)</td>
303
306
  </tr>
304
307
  <tr>
305
- <th colspan="4">ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) +YJIT [x86_64-darwin21]</th>
308
+ <th colspan="4">ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) +YJIT [x86_64-darwin21]</th>
306
309
  </tr>
307
310
  <tr>
308
311
  <th>Library</th>
@@ -312,24 +315,24 @@ A stress test of 1,501,500 operations: starting with 1,000 pushes/1000 change_pr
312
315
  </tr>
313
316
  <tr>
314
317
  <td>pairing_heap</td>
315
- <td>15</td>
316
- <td>62.243080</td>
317
- <td>0.241</td>
318
+ <td>16</td>
319
+ <td>62.576693</td>
320
+ <td>0.256</td>
318
321
  </tr>
319
322
  <tr>
320
323
  <td>Fibonacci</td>
321
324
  <td>13</td>
322
- <td>63.030390</td>
323
- <td>0.206(1.17x slower)</td>
325
+ <td>63.164614</td>
326
+ <td>0.206(1.24x slower)</td>
324
327
  </tr>
325
328
  <tr>
326
329
  <td>lazy_priority_queue</td>
327
330
  <td>10</td>
328
- <td>64.865853</td>
329
- <td>0.154(1.56x slower)</td>
331
+ <td>63.172995s</td>
332
+ <td>0.158(1.62x slower)</td>
330
333
  </tr>
331
334
  <tr>
332
- <th colspan="4">jruby 9.3.3.0 (2.6.8) 2022-01-19 b26de1f5c5 OpenJDK 64-Bit Server VM 16.0.1+9-24 on 16.0.1+9-24 +jit [darwin-x86_64]</th>
335
+ <th colspan="4">jruby 9.3.7.0 (2.6.8) 2022-08-16 c79ef237e0 OpenJDK 64-Bit Server VM 17.0.2+8-86 on 17.0.2+8-86 +indy +jit [x86_64-darwin]</th>
333
336
  </tr>
334
337
  <tr>
335
338
  <th>Library</th>
@@ -339,24 +342,24 @@ A stress test of 1,501,500 operations: starting with 1,000 pushes/1000 change_pr
339
342
  </tr>
340
343
  <tr>
341
344
  <td>pairing_heap</td>
342
- <td>15</td>
343
- <td>61.540851</td>
344
- <td>0.244</td>
345
+ <td>28</td>
346
+ <td>60.280368</td>
347
+ <td>0.465</td>
345
348
  </tr>
346
349
  <tr>
347
- <td>lazy_priority_queue</td>
348
- <td>14</td>
349
- <td>61.471507</td>
350
- <td>0.228(1.07x slower)</td>
350
+ <td>Fibonacci</td>
351
+ <td>22</td>
352
+ <td>61.405561</td>
353
+ <td>0.465(1.30x slower)</td>
351
354
  </tr>
352
355
  <tr>
353
- <td>Fibonacci</td>
354
- <td>9</td>
355
- <td>67.393730</td>
356
- <td>0.134(1.83x slower)</td>
356
+ <td>lazy_priority_queue</td>
357
+ <td>20</td>
358
+ <td>60.397535</td>
359
+ <td>0.331(1.40x slower)</td>
357
360
  </tr>
358
361
  <tr>
359
- <th colspan="4">jruby 9.3.3.0 (2.6.8) 2022-01-19 b26de1f5c5 OpenJDK 64-Bit Server VM 16.0.1+9-24 on 16.0.1+9-24 +indy +jit [darwin-x86_64]</th>
362
+ <th colspan="4">truffleruby 22.2.0, like ruby 3.0.3, GraalVM CE JVM [x86_64-darwin]</th>
360
363
  </tr>
361
364
  <tr>
362
365
  <th>Library</th>
@@ -366,48 +369,58 @@ A stress test of 1,501,500 operations: starting with 1,000 pushes/1000 change_pr
366
369
  </tr>
367
370
  <tr>
368
371
  <td>pairing_heap</td>
369
- <td>27</td>
370
- <td>61.322001</td>
371
- <td>0.440</td>
372
+ <td>70</td>
373
+ <td>60.663184</td>
374
+ <td>1.160</td>
372
375
  </tr>
373
376
  <tr>
374
- <td>Fibonacci</td>
375
- <td>21</td>
376
- <td>60.334636</td>
377
- <td>0.349(1.26x slower)</td>
377
+ <td>lazy_priority_queue</td>
378
+ <td>23</td>
379
+ <td>60.474587</td>
380
+ <td>0.382(3.04x slower)</td>
378
381
  </tr>
379
382
  <tr>
380
- <td>lazy_priority_queue</td>
381
- <td>20</td>
382
- <td>61.471507</td>
383
- <td>0.327(1.35x slower)</td>
383
+ <td>Fibonacci</td>
384
+ <td>2</td>
385
+ <td>74.873854</td>
386
+ <td>0.027(43.44x slower)</td>
384
387
  </tr>
385
388
  </table>
386
389
 
387
- ### Stress test with changing priority(N = 10) [source code](./test/performance_with_change_priority.rb)
388
- A stress test of 165 operations: starting with 10 pushes/10 change_priorities/0 pops, following 9 pushes/9 change_priorities/1 pop, and so on till 0 pushes/0 change_priorities/10 pops.
390
+ ### Stress test with changing priority or push/pop(test ignored in summary) [source code](./test/performance_pop_versus_change_priority.rb)
391
+ Start with 500 pushes, then:
392
+ * If queue supports changing priority 500 change_priority calls, then 500 pops
393
+ * If does not support changing priority 500 push calls, then 1000 pops
389
394
  <table>
390
395
  <tr>
391
- <th colspan="4">ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [x86_64-darwin21]</th>
396
+ <th colspan="4">ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-darwin21]</th>
392
397
  </tr>
393
398
  <tr>
394
399
  <th>Library</th>
395
400
  <th>Iterations per second</th>
396
401
  </tr>
397
402
  <tr>
398
- <td>pairing_heap</td>
399
- <td>5914.3</td>
403
+ <td>pairing_heap (PairingHeap)</td>
404
+ <td>436.4</td>
400
405
  </tr>
401
406
  <tr>
402
407
  <td>lazy_priority_queue</td>
403
- <td>4293.5(1.38x slower)</td>
408
+ <td>380.2(1.94x slower)</td>
409
+ </tr>
410
+ <tr>
411
+ <td>pairing_heap (SimplePairingHeap)</td>
412
+ <td>339.9.02(2.17x slower)</td>
404
413
  </tr>
405
414
  <tr>
406
415
  <td>Fibonacci</td>
407
- <td>3755.2(1.57x slower)</td>
416
+ <td>313.9(2.35x slower)</td>
408
417
  </tr>
409
418
  <tr>
410
- <th colspan="4">ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) +YJIT [x86_64-darwin21]</th>
419
+ <td>rb_heap</td>
420
+ <td>194.7(3.78 slower)</td>
421
+ </tr>
422
+ <tr>
423
+ <th colspan="4">ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) +YJIT [x86_64-darwin21]</th>
411
424
  </tr>
412
425
  <tr>
413
426
  <th>Library</th>
@@ -415,60 +428,84 @@ A stress test of 165 operations: starting with 10 pushes/10 change_priorities/0
415
428
  </tr>
416
429
  <tr>
417
430
  <td>pairing_heap</td>
418
- <td>7082.7</td>
431
+ <td>854.6</td>
419
432
  </tr>
420
433
  <tr>
421
434
  <td>Fibonacci</td>
422
- <td>6687.1(1.06x slower)</td>
435
+ <td>651.3(1.31x slower)</td>
423
436
  </tr>
424
437
  <tr>
425
438
  <td>lazy_priority_queue</td>
426
- <td>5006.4(1.41x slower)</td>
439
+ <td>453.6(1.88x slower)</td>
427
440
  </tr>
428
441
  <tr>
429
- <th colspan="4">jruby 9.3.3.0 (2.6.8) 2022-01-19 b26de1f5c5 OpenJDK 64-Bit Server VM 16.0.1+9-24 on 16.0.1+9-24 +jit [darwin-x86_64]</th>
442
+ <td>pairing_heap(SimplePairingHeap)</td>
443
+ <td>390.9(2.19x slower)</td>
444
+ </tr>
445
+ <tr>
446
+ <td>rb_heap</td>
447
+ <td>268.8(3.18x slower)</td>
448
+ </tr>
449
+ <tr>
450
+ <th colspan="4">jruby 9.3.7.0 (2.6.8) 2022-08-16 c79ef237e0 OpenJDK 64-Bit Server VM 17.0.2+8-86 on 17.0.2+8-86 +indy +jit [x86_64-darwin]</th>
430
451
  </tr>
431
452
  <tr>
432
453
  <th>Library</th>
433
454
  <th>Iterations per second</th>
434
455
  </tr>
435
456
  <tr>
436
- <td>pairing_heap</td>
437
- <td>6861.6</td>
457
+ <td>pairing_heap(PairingHeap)</td>
458
+ <td>1591</td>
459
+ </tr>
460
+ <tr>
461
+ <td>Fibonacci</td>
462
+ <td>1092(1.46x slower)</td>
438
463
  </tr>
439
464
  <tr>
440
465
  <td>lazy_priority_queue</td>
441
- <td>6446.4(1.06x slower)</td>
466
+ <td>986(1.61x slower)</td>
442
467
  </tr>
443
468
  <tr>
444
- <td>Fibonacci</td>
445
- <td>4365.4(1.57x slower)</td>
469
+ <td>pairing_heap(SimplePairingHeap)</td>
470
+ <td>562(2.37x slower)</td>
471
+ </tr>
472
+ <tr>
473
+ <td>rb_heap</td>
474
+ <td>623(2.55x slower)</td>
446
475
  </tr>
447
476
  <tr>
448
- <th colspan="4">jruby 9.3.3.0 (2.6.8) 2022-01-19 b26de1f5c5 OpenJDK 64-Bit Server VM 16.0.1+9-24 on 16.0.1+9-24 +indy +jit [darwin-x86_64]</th>
477
+ <th colspan="4">truffleruby 22.2.0, like ruby 3.0.3, GraalVM CE JVM [x86_64-darwin]</th>
449
478
  </tr>
450
479
  <tr>
451
480
  <th>Library</th>
452
481
  <th>Iterations per second</th>
453
482
  </tr>
454
483
  <tr>
455
- <td>pairing_heap</td>
456
- <td>14032</td>
484
+ <td>pairing_heap(PairingHeap)</td>
485
+ <td>7404</td>
486
+ </tr>
487
+ <tr>
488
+ <td>pairing_heap(SimplePairingHeap)</td>
489
+ <td>5104(1.45x slower)</td>
490
+ </tr>
491
+ <tr>
492
+ <td>rb_heap</td>
493
+ <td>1575(4.70x slower)</td>
457
494
  </tr>
458
495
  <tr>
459
496
  <td>Fibonacci</td>
460
- <td>12841(1.09x slower)</td>
497
+ <td>1258(5.88x slower)</td>
461
498
  </tr>
462
499
  <tr>
463
500
  <td>lazy_priority_queue</td>
464
- <td>10404(1.35x slower)</td>
501
+ <td>1004(7.38x slower)</td>
465
502
  </tr>
466
503
  </table>
467
504
 
468
505
  ### Dijkstra's algorithm with RGL [source code](./test/performance_rgl.rb)
469
506
  <table>
470
507
  <tr>
471
- <th colspan="4">ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [x86_64-darwin21]</th>
508
+ <th colspan="4">ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-darwin21]</th>
472
509
  </tr>
473
510
  <tr>
474
511
  <th>Library</th>
@@ -479,23 +516,23 @@ A stress test of 165 operations: starting with 10 pushes/10 change_priorities/0
479
516
  <tr>
480
517
  <td>pairing_heap</td>
481
518
  <td>9</td>
482
- <td>64.505899</td>
483
- <td>0.140</td>
519
+ <td>61.469343</td>
520
+ <td>0.116</td>
484
521
  </tr>
485
522
  <tr>
486
523
  <td>lazy_priority_queue</td>
487
524
  <td>8</td>
488
- <td>63.970577</td>
489
- <td>0.125(1.12x slower)</td>
525
+ <td>64.312672</td>
526
+ <td>0.125(1.18x slower)</td>
490
527
  </tr>
491
528
  <tr>
492
529
  <td>Fibonacci</td>
493
530
  <td>7</td>
494
- <td>62.573724</td>
495
- <td>0.112(1.25x slower)</td>
531
+ <td>60.555716</td>
532
+ <td>0.116(1.27x slower)</td>
496
533
  </tr>
497
534
  <tr>
498
- <th colspan="4">ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) +YJIT [x86_64-darwin21]</th>
535
+ <th colspan="4">ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) +YJIT [x86_64-darwin21]</th>
499
536
  </tr>
500
537
  <tr>
501
538
  <th>Library</th>
@@ -505,24 +542,24 @@ A stress test of 165 operations: starting with 10 pushes/10 change_priorities/0
505
542
  </tr>
506
543
  <tr>
507
544
  <td>pairing_heap</td>
508
- <td>9</td>
509
- <td>63.567801</td>
510
- <td>0.142</td>
545
+ <td>10</td>
546
+ <td>65.160945s</td>
547
+ <td>0.154</td>
511
548
  </tr>
512
549
  <tr>
513
550
  <td>Fibonacci</td>
514
551
  <td>9</td>
515
- <td>64.575079</td>
516
- <td>0.140(1.02x slower)</td>
552
+ <td>61.950587</td>
553
+ <td>0.145(1.06x slower)</td>
517
554
  </tr>
518
555
  <tr>
519
556
  <td>lazy_priority_queue</td>
520
- <td>8</td>
521
- <td>60.123700</td>
522
- <td>0.133(1.06x slower)</td>
557
+ <td>9</td>
558
+ <td>66.592123</td>
559
+ <td>0.135(1.14x slower)</td>
523
560
  </tr>
524
561
  <tr>
525
- <th colspan="4">jruby 9.3.3.0 (2.6.8) 2022-01-19 b26de1f5c5 OpenJDK 64-Bit Server VM 16.0.1+9-24 on 16.0.1+9-24 +jit [darwin-x86_64]</th>
562
+ <th colspan="4">jruby 9.3.7.0 (2.6.8) 2022-08-16 c79ef237e0 OpenJDK 64-Bit Server VM 17.0.2+8-86 on 17.0.2+8-86 +indy +jit [x86_64-darwin]</th>
526
563
  </tr>
527
564
  <tr>
528
565
  <th>Library</th>
@@ -531,25 +568,25 @@ A stress test of 165 operations: starting with 10 pushes/10 change_priorities/0
531
568
  <th>Iterations per second</th>
532
569
  </tr>
533
570
  <tr>
534
- <td>pairing_heap</td>
535
- <td>14</td>
536
- <td>64.124373</td>
537
- <td>0.218</td>
571
+ <td>lazy_priority_queue</td>
572
+ <td>20</td>
573
+ <td>61.149944</td>
574
+ <td>0.328</td>
538
575
  </tr>
539
576
  <tr>
540
- <td>lazy_priority_queue</td>
541
- <td>13</td>
542
- <td>61.147807</td>
543
- <td>0.213(1.03x slower)</td>
577
+ <td>pairing_heap</td>
578
+ <td>20</td>
579
+ <td>61.210225s</td>
580
+ <td>0.328</td>
544
581
  </tr>
545
582
  <tr>
546
583
  <td>Fibonacci</td>
547
- <td>10</td>
548
- <td>64.250067</td>
549
- <td>0.156(1.40x slower)</td>
584
+ <td>18</td>
585
+ <td>62.330882</td>
586
+ <td>0.292(1.12x slower)</td>
550
587
  </tr>
551
588
  <tr>
552
- <th colspan="4">jruby 9.3.3.0 (2.6.8) 2022-01-19 b26de1f5c5 OpenJDK 64-Bit Server VM 16.0.1+9-24 on 16.0.1+9-24 +indy +jit [darwin-x86_64]</th>
589
+ <th colspan="4">truffleruby 22.2.0, like ruby 3.0.3, GraalVM CE JVM [x86_64-darwin]</th>
553
590
  </tr>
554
591
  <tr>
555
592
  <th>Library</th>
@@ -559,21 +596,21 @@ A stress test of 165 operations: starting with 10 pushes/10 change_priorities/0
559
596
  </tr>
560
597
  <tr>
561
598
  <td>pairing_heap</td>
562
- <td>22</td>
563
- <td>61.450341</td>
564
- <td>0.361</td>
599
+ <td>59</td>
600
+ <td>60.053843</td>
601
+ <td>0.991</td>
565
602
  </tr>
566
603
  <tr>
567
- <td>Fibonacci</td>
568
- <td>18</td>
569
- <td>61.618204</td>
570
- <td>0.296(1.22x slower)</td>
604
+ <td>lazy_priority_queue</td>
605
+ <td>34</td>
606
+ <td>60.586461</td>
607
+ <td>0.563(1.76x slower)</td>
571
608
  </tr>
572
609
  <tr>
573
- <td>lazy_priority_queue</td>
574
- <td>17</td>
575
- <td>60.156184</td>
576
- <td>0.283(1.27x slower)</td>
610
+ <td>Fibonacci</td>
611
+ <td>31</td>
612
+ <td>60.633711</td>
613
+ <td>0.520(1.90x slower)</td>
577
614
  </tr>
578
615
  </table>
579
616
 
@@ -581,7 +618,7 @@ A stress test of 165 operations: starting with 10 pushes/10 change_priorities/0
581
618
  Heaps that support change_priority operation use it. Heaps that do not support it use dijkstra implementation that do not rely on change_priority instead and do additional pops and pushes instead(see Dijkstra-NoDec from [Priority Queues and Dijkstra’s Algorithm](https://www3.cs.stonybrook.edu/~rezaul/papers/TR-07-54.pdf)).
582
619
  <table>
583
620
  <tr>
584
- <th colspan="4">ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [x86_64-darwin21]</th>
621
+ <th colspan="4">ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-darwin21]</th>
585
622
  </tr>
586
623
  <tr>
587
624
  <th>Library</th>
@@ -591,36 +628,36 @@ Heaps that support change_priority operation use it. Heaps that do not support i
591
628
  </tr>
592
629
  <tr>
593
630
  <td>pairing_heap (SimplePairingHeap)</td>
594
- <td>25</td>
595
- <td>61.386477</td>
596
- <td>0.407</td>
631
+ <td>28</td>
632
+ <td>62.100299</td>
633
+ <td>0.451</td>
597
634
  </tr>
598
635
  <tr>
599
636
  <td>pairing_heap (PairingHeap)</td>
600
- <td>22</td>
601
- <td>62.044470</td>
602
- <td>0.355(1.15x slower)</td>
637
+ <td>23</td>
638
+ <td>60.633153</td>
639
+ <td>0.380(1.19x slower)</td>
603
640
  </tr>
604
641
  <tr>
605
642
  <td>rb_heap</td>
606
- <td>13</td>
607
- <td>60.717112</td>
608
- <td>0.214(1.90x slower)</td>
643
+ <td>14</td>
644
+ <td>62.019763</td>
645
+ <td>0.226(2.00x slower)</td>
609
646
  </tr>
610
647
  <tr>
611
648
  <td>lazy_priority_queue</td>
612
- <td>10</td>
613
- <td>61.730614</td>
614
- <td>0.162(2.51x slower)</td>
649
+ <td>11</td>
650
+ <td>63.105064s</td>
651
+ <td>0.174(2.58x slower)</td>
615
652
  </tr>
616
653
  <tr>
617
654
  <td>Fibonacci</td>
618
655
  <td>10</td>
619
- <td>65.899982</td>
620
- <td>0.152(2.68x slower)</td>
656
+ <td>64.407187</td>
657
+ <td>0.155(2.90x slower)</td>
621
658
  </tr>
622
659
  <tr>
623
- <th colspan="4">ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) +YJIT [x86_64-darwin21]</th>
660
+ <th colspan="4">ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) +YJIT [x86_64-darwin21]</th>
624
661
  </tr>
625
662
  <tr>
626
663
  <th>Library</th>
@@ -630,36 +667,36 @@ Heaps that support change_priority operation use it. Heaps that do not support i
630
667
  </tr>
631
668
  <tr>
632
669
  <td>pairing_heap (SimplePairingHeap)</td>
633
- <td>29</td>
634
- <td>61.656995</td>
635
- <td>0.471</td>
670
+ <td>32</td>
671
+ <td>61.289321</td>
672
+ <td>0.522</td>
636
673
  </tr>
637
674
  <tr>
638
675
  <td>pairing_heap (PairingHeap)</td>
639
- <td>24</td>
640
- <td>61.813482</td>
641
- <td>0.389(1.21x slower)</td>
676
+ <td>26</td>
677
+ <td>60.657625</td>
678
+ <td>0.429(1.22x slower)</td>
642
679
  </tr>
643
680
  <tr>
644
681
  <td>rb_heap</td>
645
682
  <td>19</td>
646
- <td>62.191040</td>
647
- <td>0.306(1.54x slower)</td>
683
+ <td>60.710888s</td>
684
+ <td>0.313(1.67x slower)</td>
648
685
  </tr>
649
686
  <tr>
650
687
  <td>Fibonacci</td>
651
- <td>18</td>
652
- <td>60.062072</td>
653
- <td>0.300(1.57x slower)</td>
688
+ <td>19</td>
689
+ <td>61.471203</td>
690
+ <td>0.310(1.69x slower)</td>
654
691
  </tr>
655
692
  <tr>
656
693
  <td>lazy_priority_queue</td>
657
694
  <td>12</td>
658
- <td>60.860292</td>
659
- <td>0.197(2.38x slower)</td>
695
+ <td>60.125779</td>
696
+ <td>0.200(2.61x slower)</td>
660
697
  </tr>
661
698
  <tr>
662
- <th colspan="4">jruby 9.3.3.0 (2.6.8) 2022-01-19 b26de1f5c5 OpenJDK 64-Bit Server VM 16.0.1+9-24 on 16.0.1+9-24 +jit [darwin-x86_64]</th>
699
+ <th colspan="4">jruby 9.3.7.0 (2.6.8) 2022-08-16 c79ef237e0 OpenJDK 64-Bit Server VM 17.0.2+8-86 on 17.0.2+8-86 +indy +jit [x86_64-darwin]</th>
663
700
  </tr>
664
701
  <tr>
665
702
  <th>Library</th>
@@ -669,36 +706,36 @@ Heaps that support change_priority operation use it. Heaps that do not support i
669
706
  </tr>
670
707
  <tr>
671
708
  <td>pairing_heap (SimplePairingHeap)</td>
672
- <td>24</td>
673
- <td>61.972936</td>
674
- <td>0.387</td>
709
+ <td>46</td>
710
+ <td>61.226924</td>
711
+ <td>0.753</td>
675
712
  </tr>
676
713
  <tr>
677
- <td>pairing_heap (PairingHeap)</td>
678
- <td>20</td>
679
- <td>62.178839</td>
680
- <td>0.322(1.20x slower)</td>
714
+ <td>rb_heap</td>
715
+ <td>38</td>
716
+ <td>60.563995</td>
717
+ <td>0.628(1.20x slower)</td>
681
718
  </tr>
682
719
  <tr>
683
- <td>lazy_priority_queue</td>
684
- <td>14</td>
685
- <td>61.540058s</td>
686
- <td>0.228(1.70x slower)</td>
720
+ <td>pairing_heap (PairingHeap)</td>
721
+ <td>37</td>
722
+ <td>60.928350</td>
723
+ <td>0.608(1.24x slower)</td>
687
724
  </tr>
688
725
  <tr>
689
- <td>rb_heap</td>
690
- <td>14</td>
691
- <td>62.125831</td>
692
- <td>0.225(1.72x slower)</td>
726
+ <td>Fibonacci</td>
727
+ <td>28</td>
728
+ <td>61.136970</td>
729
+ <td>0.461(1.63x slower)</td>
693
730
  </tr>
694
731
  <tr>
695
- <td>Fibonacci</td>
696
- <td>10</td>
697
- <td>62.319669</td>
698
- <td>0.155(2.41x slower)</td>
732
+ <td>lazy_priority_queue</td>
733
+ <td>22</td>
734
+ <td>62.214796</td>
735
+ <td>0.354(2.13x slower)</td>
699
736
  </tr>
700
737
  <tr>
701
- <th colspan="4">jruby 9.3.3.0 (2.6.8) 2022-01-19 b26de1f5c5 OpenJDK 64-Bit Server VM 16.0.1+9-24 on 16.0.1+9-24 +indy +jit [darwin-x86_64]</th>
738
+ <th colspan="4">truffleruby 22.2.0, like ruby 3.0.3, GraalVM CE JVM [x86_64-darwin]</th>
702
739
  </tr>
703
740
  <tr>
704
741
  <th>Library</th>
@@ -708,33 +745,33 @@ Heaps that support change_priority operation use it. Heaps that do not support i
708
745
  </tr>
709
746
  <tr>
710
747
  <td>pairing_heap (SimplePairingHeap)</td>
711
- <td>47</td>
712
- <td>61.192519</td>
713
- <td>0.770</td>
748
+ <td>176</td>
749
+ <td>60.029817</td>
750
+ <td>3.006</td>
714
751
  </tr>
715
752
  <tr>
716
- <td>rb_heap</td>
717
- <td>39</td>
718
- <td>61.028398</td>
719
- <td>0.639(1.20x slower)</td>
753
+ <td>pairing_heap (PairingHeap)</td>
754
+ <td>124</td>
755
+ <td>60.366607</td>
756
+ <td>2.078(1.45x slower)</td>
720
757
  </tr>
721
758
  <tr>
722
- <td>pairing_heap (PairingHeap)</td>
723
- <td>36</td>
724
- <td>60.035760</td>
725
- <td>0.601(1.28x slower)</td>
759
+ <td>rb_heap</td>
760
+ <td>95</td>
761
+ <td>60.021043</td>
762
+ <td>1.585(1.90x slower)</td>
726
763
  </tr>
727
764
  <tr>
728
765
  <td>Fibonacci</td>
729
- <td>28</td>
730
- <td>61.599202</td>
731
- <td>0.456(1.69x slower)</td>
766
+ <td>38</td>
767
+ <td>60.020976</td>
768
+ <td>0.636(4.72x slower)</td>
732
769
  </tr>
733
770
  <tr>
734
771
  <td>lazy_priority_queue</td>
735
- <td>22</td>
736
- <td>60.540367</td>
737
- <td>0.364(2.12x slower)</td>
772
+ <td>27</td>
773
+ <td>61.349925</td>
774
+ <td>0.445(6.75x slower)</td>
738
775
  </tr>
739
776
  </table>
740
777
 
@@ -742,7 +779,7 @@ Heaps that support change_priority operation use it. Heaps that do not support i
742
779
  #### Change priority required
743
780
  <table>
744
781
  <tr>
745
- <th colspan="4">ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [x86_64-darwin21]</th>
782
+ <th colspan="4">ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-darwin21]</th>
746
783
  </tr>
747
784
  <tr>
748
785
  <th>Library</th>
@@ -754,14 +791,14 @@ Heaps that support change_priority operation use it. Heaps that do not support i
754
791
  </tr>
755
792
  <tr>
756
793
  <td>lazy_priority_queue</td>
757
- <td>1.523x slower</td>
794
+ <td>1.688x slower</td>
758
795
  </tr>
759
796
  <tr>
760
797
  <td>Fibonacci</td>
761
- <td>1.751x slower</td>
798
+ <td>1.987x slower</td>
762
799
  </tr>
763
800
  <tr>
764
- <th colspan="4">ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) +YJIT [x86_64-darwin21]</th>
801
+ <th colspan="4">ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) +YJIT [x86_64-darwin21]</th>
765
802
  </tr>
766
803
  <tr>
767
804
  <th>Library</th>
@@ -773,14 +810,14 @@ Heaps that support change_priority operation use it. Heaps that do not support i
773
810
  </tr>
774
811
  <tr>
775
812
  <td>Fibonacci</td>
776
- <td>1.146x slower</td>
813
+ <td>1.256x slower</td>
777
814
  </tr>
778
815
  <tr>
779
816
  <td>lazy_priority_queue</td>
780
- <td>1.482x slower</td>
817
+ <td>1.648x slower</td>
781
818
  </tr>
782
819
  <tr>
783
- <th colspan="4">jruby 9.3.3.0 (2.6.8) 2022-01-19 b26de1f5c5 OpenJDK 64-Bit Server VM 16.0.1+9-24 on 16.0.1+9-24 +jit [darwin-x86_64]</th>
820
+ <th colspan="4">jruby 9.3.7.0 (2.6.8) 2022-08-16 c79ef237e0 OpenJDK 64-Bit Server VM 17.0.2+8-86 on 17.0.2+8-86 +indy +jit [x86_64-darwin]</th>
784
821
  </tr>
785
822
  <tr>
786
823
  <th>Library</th>
@@ -791,16 +828,15 @@ Heaps that support change_priority operation use it. Heaps that do not support i
791
828
  <td>1</td>
792
829
  </tr>
793
830
  <tr>
794
- <td>lazy_priority_queue</td>
795
- <td>1.153x slower</td>
796
-
831
+ <td>Fibonacci</td>
832
+ <td>1.327x slower</td>
797
833
  </tr>
798
834
  <tr>
799
- <td>Fibonacci</td>
800
- <td>1.793x slower</td>
835
+ <td>lazy_priority_queue</td>
836
+ <td>1.383x slower</td>
801
837
  </tr>
802
838
  <tr>
803
- <th colspan="4">jruby 9.3.3.0 (2.6.8) 2022-01-19 b26de1f5c5 OpenJDK 64-Bit Server VM 16.0.1+9-24 on 16.0.1+9-24 +indy +jit [darwin-x86_64]</th>
839
+ <th colspan="4">truffleruby 22.2.0, like ruby 3.0.3, GraalVM CE JVM [x86_64-darwin]</th>
804
840
  </tr>
805
841
  <tr>
806
842
  <th>Library</th>
@@ -811,19 +847,19 @@ Heaps that support change_priority operation use it. Heaps that do not support i
811
847
  <td>1</td>
812
848
  </tr>
813
849
  <tr>
814
- <td>Fibonacci</td>
815
- <td>1.222x slower</td>
850
+ <td>lazy_priority_queue</td>
851
+ <td>3.878x slower</td>
816
852
  </tr>
817
853
  <tr>
818
- <td>lazy_priority_queue</td>
819
- <td>1.394x slower</td>
854
+ <td>Fibonacci</td>
855
+ <td>9.889x slower</td>
820
856
  </tr>
821
857
  </table>
822
858
 
823
859
  #### Change priority not required
824
860
  <table>
825
861
  <tr>
826
- <th colspan="4">ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [x86_64-darwin21]</th>
862
+ <th colspan="4">ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-darwin21]</th>
827
863
  </tr>
828
864
  <tr>
829
865
  <th>Library</th>
@@ -835,22 +871,22 @@ Heaps that support change_priority operation use it. Heaps that do not support i
835
871
  </tr>
836
872
  <tr>
837
873
  <td>pairing_heap (PairingHeap)</td>
838
- <td>1.209x slower</td>
874
+ <td>1.318x slower</td>
839
875
  </tr>
840
876
  <tr>
841
877
  <td>rb_heap</td>
842
- <td>1.954x slower</td>
878
+ <td>1.8x slower</td>
843
879
  </tr>
844
880
  <tr>
845
881
  <td>lazy_priority_queue</td>
846
- <td>2.235x slower</td>
882
+ <td>2.519x slower</td>
847
883
  </tr>
848
884
  <tr>
849
885
  <td>Fibonacci</td>
850
- <td>2.588x slower</td>
886
+ <td>2.989x slower</td>
851
887
  </tr>
852
888
  <tr>
853
- <th colspan="4">ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) +YJIT [x86_64-darwin21]</th>
889
+ <th colspan="4">ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) +YJIT [x86_64-darwin21]</th>
854
890
  </tr>
855
891
  <tr>
856
892
  <th>Library</th>
@@ -862,22 +898,22 @@ Heaps that support change_priority operation use it. Heaps that do not support i
862
898
  </tr>
863
899
  <tr>
864
900
  <td>pairing_heap (PairingHeap)</td>
865
- <td>1.273x slower</td>
901
+ <td>1.348x slower</td>
866
902
  </tr>
867
903
  <tr>
868
- <td>Fibonacci</td>
869
- <td>1.590x slower</td>
904
+ <td>rb_heap</td>
905
+ <td>1.490x slower</td>
870
906
  </tr>
871
907
  <tr>
872
- <td>rb_heap</td>
873
- <td>1.666x slower</td>
908
+ <td>Fibonacci</td>
909
+ <td>1.792x slower</td>
874
910
  </tr>
875
911
  <tr>
876
912
  <td>lazy_priority_queue</td>
877
- <td>2.230x slower</td>
913
+ <td>2.492x slower</td>
878
914
  </tr>
879
915
  <tr>
880
- <th colspan="4">jruby 9.3.3.0 (2.6.8) 2022-01-19 b26de1f5c5 OpenJDK 64-Bit Server VM 16.0.1+9-24 on 16.0.1+9-24 +jit [darwin-x86_64]</th>
916
+ <th colspan="4">jruby 9.3.7.0 (2.6.8) 2022-08-16 c79ef237e0 OpenJDK 64-Bit Server VM 17.0.2+8-86 on 17.0.2+8-86 +indy +jit [x86_64-darwin]</th>
881
917
  </tr>
882
918
  <tr>
883
919
  <th>Library</th>
@@ -888,23 +924,23 @@ Heaps that support change_priority operation use it. Heaps that do not support i
888
924
  <td>1</td>
889
925
  </tr>
890
926
  <tr>
891
- <td>pairing_heap (PairingHeap)</td>
892
- <td>1.296x slower</td>
927
+ <td>rb_heap</td>
928
+ <td>1.292x slower</td>
893
929
  </tr>
894
930
  <tr>
895
- <td>lazy_priority_queue</td>
896
- <td>1.607x slower</td>
931
+ <td>pairing_heap (PairingHeap)</td>
932
+ <td>1.359x slower</td>
897
933
  </tr>
898
934
  <tr>
899
- <td>rb_heap</td>
900
- <td>1.710x slower</td>
935
+ <td>Fibonacci</td>
936
+ <td>1.824x slower</td>
901
937
  </tr>
902
938
  <tr>
903
- <td>Fibonacci</td>
904
- <td>2.452x slower</td>
939
+ <td>lazy_priority_queue</td>
940
+ <td>2.115x slower</td>
905
941
  </tr>
906
942
  <tr>
907
- <th colspan="4">jruby 9.3.3.0 (2.6.8) 2022-01-19 b26de1f5c5 OpenJDK 64-Bit Server VM 16.0.1+9-24 on 16.0.1+9-24 +indy +jit [darwin-x86_64]</th>
943
+ <th colspan="4">truffleruby 22.2.0, like ruby 3.0.3, GraalVM CE JVM [x86_64-darwin]</th>
908
944
  </tr>
909
945
  <tr>
910
946
  <th>Library</th>
@@ -916,19 +952,19 @@ Heaps that support change_priority operation use it. Heaps that do not support i
916
952
  </tr>
917
953
  <tr>
918
954
  <td>pairing_heap (PairingHeap)</td>
919
- <td>1.353x slower</td>
955
+ <td>1.865x slower</td>
920
956
  </tr>
921
957
  <tr>
922
958
  <td>rb_heap</td>
923
- <td>1.522x slower</td>
959
+ <td>1.915x slower</td>
924
960
  </tr>
925
961
  <tr>
926
- <td>Fibonacci</td>
927
- <td>1.730x slower</td>
962
+ <td>lazy_priority_queue</td>
963
+ <td>8.791x slower</td>
928
964
  </tr>
929
965
  <tr>
930
- <td>lazy_priority_queue</td>
931
- <td>2.044x slower</td>
966
+ <td>Fibonacci</td>
967
+ <td>26.044x slower</td>
932
968
  </tr>
933
969
  </table>
934
970