pairing_heap 0.3.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/main.yml +11 -8
- data/README.md +324 -289
- data/lib/pairing_heap/version.rb +1 -1
- data/lib/pairing_heap.rb +82 -50
- metadata +2 -2
data/README.md
CHANGED
@@ -2,7 +2,9 @@
|
|
2
2
|
|
3
3
|
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
4
|
|
5
|
-
|
5
|
+
PairingHeap is currently being used as the priority queue data structure in [RGL](https://github.com/monora/rgl/).
|
6
|
+
|
7
|
+
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
8
|
|
7
9
|
## Installation
|
8
10
|
|
@@ -104,7 +106,7 @@ This API is a drop-in replacement of [lazy_priority_queue](https://github.com/ma
|
|
104
106
|
## Benchmarks
|
105
107
|
I picked the three fastest pure Ruby priority queue implementations I was aware of for the comparison:
|
106
108
|
|
107
|
-
* [lazy_priority_queue](https://github.com/matiasbattocchia/lazy_priority_queue) that uses a lazy binomial heap. This is probably the most popular option
|
109
|
+
* [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
110
|
* 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
111
|
* [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
112
|
|
@@ -114,7 +116,7 @@ Original performance test from [lazy_priority_queue](https://github.com/matiasba
|
|
114
116
|
> 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
117
|
<table>
|
116
118
|
<tr>
|
117
|
-
<th colspan="4">ruby 3.1.
|
119
|
+
<th colspan="4">ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-darwin21]</th>
|
118
120
|
</tr>
|
119
121
|
<tr>
|
120
122
|
<th>Library</th>
|
@@ -124,36 +126,36 @@ Original performance test from [lazy_priority_queue](https://github.com/matiasba
|
|
124
126
|
</tr>
|
125
127
|
<tr>
|
126
128
|
<td>pairing_heap (SimplePairingHeap)</td>
|
127
|
-
<td>
|
128
|
-
<td>
|
129
|
-
<td>0.
|
129
|
+
<td>23</td>
|
130
|
+
<td>62.014773</td>
|
131
|
+
<td>0.371</td>
|
130
132
|
</tr>
|
131
133
|
<tr>
|
132
134
|
<td>pairing_heap (PairingHeap)</td>
|
133
|
-
<td>
|
134
|
-
<td>63.
|
135
|
-
<td>0.
|
135
|
+
<td>16</td>
|
136
|
+
<td>63.135240</td>
|
137
|
+
<td>0.253(1.46x slower)</td>
|
136
138
|
</tr>
|
137
139
|
<tr>
|
138
|
-
<td>
|
139
|
-
<td>
|
140
|
-
<td>
|
141
|
-
<td>0.
|
140
|
+
<td>rb_heap</td>
|
141
|
+
<td>14</td>
|
142
|
+
<td>61.123304</td>
|
143
|
+
<td>0.229(1.62x slower)</td>
|
142
144
|
</tr>
|
143
145
|
<tr>
|
144
|
-
<td>
|
145
|
-
<td>
|
146
|
-
<td>
|
147
|
-
<td>0.
|
146
|
+
<td>lazy_priority_queue</td>
|
147
|
+
<td>10</td>
|
148
|
+
<td>66.208647</td>
|
149
|
+
<td>0.151(2.46x slower)</td>
|
148
150
|
</tr>
|
149
151
|
<tr>
|
150
152
|
<td>Fibonacci</td>
|
151
153
|
<td>8</td>
|
152
|
-
<td>66.
|
153
|
-
<td>0.
|
154
|
+
<td>66.353147</td>
|
155
|
+
<td>0.121(3.08x slower)</td>
|
154
156
|
</tr>
|
155
157
|
<tr>
|
156
|
-
<th colspan="4">ruby 3.1.
|
158
|
+
<th colspan="4">ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) +YJIT [x86_64-darwin21]</th>
|
157
159
|
</tr>
|
158
160
|
<tr>
|
159
161
|
<th>Library</th>
|
@@ -163,36 +165,36 @@ Original performance test from [lazy_priority_queue](https://github.com/matiasba
|
|
163
165
|
</tr>
|
164
166
|
<tr>
|
165
167
|
<td>pairing_heap (SimplePairingHeap)</td>
|
166
|
-
<td>
|
167
|
-
<td>
|
168
|
-
<td>0.
|
168
|
+
<td>25</td>
|
169
|
+
<td>60.423579</td>
|
170
|
+
<td>0.414</td>
|
171
|
+
</tr>
|
172
|
+
<tr>
|
173
|
+
<td>rb_heap</td>
|
174
|
+
<td>19</td>
|
175
|
+
<td>60.869907</td>
|
176
|
+
<td>0.312(1.33x slower)</td>
|
169
177
|
</tr>
|
170
178
|
<tr>
|
171
179
|
<td>pairing_heap (PairingHeap)</td>
|
172
|
-
<td>
|
173
|
-
<td>61.
|
174
|
-
<td>0.
|
180
|
+
<td>17</td>
|
181
|
+
<td>61.389127</td>
|
182
|
+
<td>0.277(1.49x slower)</td>
|
175
183
|
</tr>
|
176
184
|
<tr>
|
177
185
|
<td>Fibonacci</td>
|
178
186
|
<td>14</td>
|
179
|
-
<td>64.
|
180
|
-
<td>0.217(1.
|
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>
|
187
|
+
<td>64.417807</td>
|
188
|
+
<td>0.217(1.90x slower)</td>
|
187
189
|
</tr>
|
188
190
|
<tr>
|
189
191
|
<td>lazy_priority_queue</td>
|
190
192
|
<td>11</td>
|
191
|
-
<td>
|
192
|
-
<td>0.
|
193
|
+
<td>63.151856</td>
|
194
|
+
<td>0.174(2.38x slower)</td>
|
193
195
|
</tr>
|
194
196
|
<tr>
|
195
|
-
<th colspan="4">jruby 9.3.
|
197
|
+
<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
198
|
</tr>
|
197
199
|
<tr>
|
198
200
|
<th>Library</th>
|
@@ -202,36 +204,36 @@ Original performance test from [lazy_priority_queue](https://github.com/matiasba
|
|
202
204
|
</tr>
|
203
205
|
<tr>
|
204
206
|
<td>pairing_heap (SimplePairingHeap)</td>
|
205
|
-
<td>
|
206
|
-
<td>60.
|
207
|
-
<td>0.
|
207
|
+
<td>47</td>
|
208
|
+
<td>60.391633</td>
|
209
|
+
<td>0.778</td>
|
208
210
|
</tr>
|
209
211
|
<tr>
|
210
|
-
<td>
|
211
|
-
<td>
|
212
|
-
<td>60.
|
213
|
-
<td>0.
|
212
|
+
<td>rb_heap</td>
|
213
|
+
<td>34</td>
|
214
|
+
<td>60.878639</td>
|
215
|
+
<td>0.559(1.39x slower)</td>
|
214
216
|
</tr>
|
215
217
|
<tr>
|
216
|
-
<td>
|
217
|
-
<td>
|
218
|
-
<td>61.
|
219
|
-
<td>0.
|
218
|
+
<td>pairing_heap (PairingHeap)</td>
|
219
|
+
<td>32</td>
|
220
|
+
<td>61.211985</td>
|
221
|
+
<td>0.523(1.49x slower)</td>
|
220
222
|
</tr>
|
221
223
|
<tr>
|
222
|
-
<td>
|
223
|
-
<td>
|
224
|
-
<td>
|
225
|
-
<td>0.
|
224
|
+
<td>Fibonacci</td>
|
225
|
+
<td>23</td>
|
226
|
+
<td>60.297670</td>
|
227
|
+
<td>0.382(2.04x slower)</td>
|
226
228
|
</tr>
|
227
229
|
<tr>
|
228
|
-
<td>
|
229
|
-
<td>
|
230
|
-
<td>
|
231
|
-
<td>0.
|
230
|
+
<td>lazy_priority_queue</td>
|
231
|
+
<td>23</td>
|
232
|
+
<td>61.973538</td>
|
233
|
+
<td>0.371(2.10x slower)</td>
|
232
234
|
</tr>
|
233
235
|
<tr>
|
234
|
-
<th colspan="4">
|
236
|
+
<th colspan="4">truffleruby 22.2.0, like ruby 3.0.3, GraalVM CE JVM [x86_64-darwin]</th>
|
235
237
|
</tr>
|
236
238
|
<tr>
|
237
239
|
<th>Library</th>
|
@@ -241,33 +243,33 @@ Original performance test from [lazy_priority_queue](https://github.com/matiasba
|
|
241
243
|
</tr>
|
242
244
|
<tr>
|
243
245
|
<td>pairing_heap (SimplePairingHeap)</td>
|
244
|
-
<td>
|
245
|
-
<td>60.
|
246
|
-
<td>
|
246
|
+
<td>206</td>
|
247
|
+
<td>60.191686</td>
|
248
|
+
<td>3.433</td>
|
247
249
|
</tr>
|
248
250
|
<tr>
|
249
|
-
<td>
|
250
|
-
<td>
|
251
|
-
<td>60.
|
252
|
-
<td>
|
251
|
+
<td>rb_heap</td>
|
252
|
+
<td>97</td>
|
253
|
+
<td>60.134011</td>
|
254
|
+
<td>1.614(1.93x slower)</td>
|
253
255
|
</tr>
|
254
256
|
<tr>
|
255
|
-
<td>
|
256
|
-
<td>
|
257
|
-
<td>
|
258
|
-
<td>
|
257
|
+
<td>pairing_heap (PairingHeap)</td>
|
258
|
+
<td>85</td>
|
259
|
+
<td>60.193608s</td>
|
260
|
+
<td>1.434(2.40x slower)</td>
|
259
261
|
</tr>
|
260
262
|
<tr>
|
261
|
-
<td>
|
262
|
-
<td>
|
263
|
-
<td>
|
264
|
-
<td>0.
|
263
|
+
<td>lazy_priority_queue</td>
|
264
|
+
<td>19</td>
|
265
|
+
<td>63.212429</td>
|
266
|
+
<td>0.301(11.45x slower)</td>
|
265
267
|
</tr>
|
266
268
|
<tr>
|
267
|
-
<td>
|
268
|
-
<td>
|
269
|
-
<td>
|
270
|
-
<td>0.
|
269
|
+
<td>Fibonacci</td>
|
270
|
+
<td>2</td>
|
271
|
+
<td>83.508571</td>
|
272
|
+
<td>0.024(143.70x slower)</td>
|
271
273
|
</tr>
|
272
274
|
</table>
|
273
275
|
|
@@ -275,7 +277,7 @@ Original performance test from [lazy_priority_queue](https://github.com/matiasba
|
|
275
277
|
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
278
|
<table>
|
277
279
|
<tr>
|
278
|
-
<th colspan="4">ruby 3.1.
|
280
|
+
<th colspan="4">ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-darwin21]</th>
|
279
281
|
</tr>
|
280
282
|
<tr>
|
281
283
|
<th>Library</th>
|
@@ -285,24 +287,24 @@ A stress test of 1,501,500 operations: starting with 1,000 pushes/1000 change_pr
|
|
285
287
|
</tr>
|
286
288
|
<tr>
|
287
289
|
<td>pairing_heap</td>
|
288
|
-
<td>
|
289
|
-
<td>
|
290
|
-
<td>0.
|
290
|
+
<td>15</td>
|
291
|
+
<td>62.946988</td>
|
292
|
+
<td>0.238</td>
|
291
293
|
</tr>
|
292
294
|
<tr>
|
293
295
|
<td>lazy_priority_queue</td>
|
294
296
|
<td>9</td>
|
295
|
-
<td>
|
296
|
-
<td>0.
|
297
|
+
<td>61.876691</td>
|
298
|
+
<td>0.145(1.64x slower)</td>
|
297
299
|
</tr>
|
298
300
|
<tr>
|
299
301
|
<td>Fibonacci</td>
|
300
302
|
<td>8</td>
|
301
|
-
<td>67.
|
302
|
-
<td>0.
|
303
|
+
<td>67.809982</td>
|
304
|
+
<td>0.118(2.02x slower)</td>
|
303
305
|
</tr>
|
304
306
|
<tr>
|
305
|
-
<th colspan="4">ruby 3.1.
|
307
|
+
<th colspan="4">ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) +YJIT [x86_64-darwin21]</th>
|
306
308
|
</tr>
|
307
309
|
<tr>
|
308
310
|
<th>Library</th>
|
@@ -312,24 +314,24 @@ A stress test of 1,501,500 operations: starting with 1,000 pushes/1000 change_pr
|
|
312
314
|
</tr>
|
313
315
|
<tr>
|
314
316
|
<td>pairing_heap</td>
|
315
|
-
<td>
|
316
|
-
<td>62.
|
317
|
-
<td>0.
|
317
|
+
<td>16</td>
|
318
|
+
<td>62.576693</td>
|
319
|
+
<td>0.256</td>
|
318
320
|
</tr>
|
319
321
|
<tr>
|
320
322
|
<td>Fibonacci</td>
|
321
323
|
<td>13</td>
|
322
|
-
<td>63.
|
323
|
-
<td>0.206(1.
|
324
|
+
<td>63.164614</td>
|
325
|
+
<td>0.206(1.24x slower)</td>
|
324
326
|
</tr>
|
325
327
|
<tr>
|
326
328
|
<td>lazy_priority_queue</td>
|
327
329
|
<td>10</td>
|
328
|
-
<td>
|
329
|
-
<td>0.
|
330
|
+
<td>63.172995s</td>
|
331
|
+
<td>0.158(1.62x slower)</td>
|
330
332
|
</tr>
|
331
333
|
<tr>
|
332
|
-
<th colspan="4">jruby 9.3.
|
334
|
+
<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
335
|
</tr>
|
334
336
|
<tr>
|
335
337
|
<th>Library</th>
|
@@ -339,24 +341,24 @@ A stress test of 1,501,500 operations: starting with 1,000 pushes/1000 change_pr
|
|
339
341
|
</tr>
|
340
342
|
<tr>
|
341
343
|
<td>pairing_heap</td>
|
342
|
-
<td>
|
343
|
-
<td>
|
344
|
-
<td>0.
|
344
|
+
<td>28</td>
|
345
|
+
<td>60.280368</td>
|
346
|
+
<td>0.465</td>
|
345
347
|
</tr>
|
346
348
|
<tr>
|
347
|
-
<td>
|
348
|
-
<td>
|
349
|
-
<td>61.
|
350
|
-
<td>0.
|
349
|
+
<td>Fibonacci</td>
|
350
|
+
<td>22</td>
|
351
|
+
<td>61.405561</td>
|
352
|
+
<td>0.465(1.30x slower)</td>
|
351
353
|
</tr>
|
352
354
|
<tr>
|
353
|
-
<td>
|
354
|
-
<td>
|
355
|
-
<td>
|
356
|
-
<td>0.
|
355
|
+
<td>lazy_priority_queue</td>
|
356
|
+
<td>20</td>
|
357
|
+
<td>60.397535</td>
|
358
|
+
<td>0.331(1.40x slower)</td>
|
357
359
|
</tr>
|
358
360
|
<tr>
|
359
|
-
<th colspan="4">
|
361
|
+
<th colspan="4">truffleruby 22.2.0, like ruby 3.0.3, GraalVM CE JVM [x86_64-darwin]</th>
|
360
362
|
</tr>
|
361
363
|
<tr>
|
362
364
|
<th>Library</th>
|
@@ -366,48 +368,58 @@ A stress test of 1,501,500 operations: starting with 1,000 pushes/1000 change_pr
|
|
366
368
|
</tr>
|
367
369
|
<tr>
|
368
370
|
<td>pairing_heap</td>
|
369
|
-
<td>
|
370
|
-
<td>
|
371
|
-
<td>
|
371
|
+
<td>70</td>
|
372
|
+
<td>60.663184</td>
|
373
|
+
<td>1.160</td>
|
372
374
|
</tr>
|
373
375
|
<tr>
|
374
|
-
<td>
|
375
|
-
<td>
|
376
|
-
<td>60.
|
377
|
-
<td>0.
|
376
|
+
<td>lazy_priority_queue</td>
|
377
|
+
<td>23</td>
|
378
|
+
<td>60.474587</td>
|
379
|
+
<td>0.382(3.04x slower)</td>
|
378
380
|
</tr>
|
379
381
|
<tr>
|
380
|
-
<td>
|
381
|
-
<td>
|
382
|
-
<td>
|
383
|
-
<td>0.
|
382
|
+
<td>Fibonacci</td>
|
383
|
+
<td>2</td>
|
384
|
+
<td>74.873854</td>
|
385
|
+
<td>0.027(43.44x slower)</td>
|
384
386
|
</tr>
|
385
387
|
</table>
|
386
388
|
|
387
|
-
### Stress test with changing priority(
|
388
|
-
|
389
|
+
### Stress test with changing priority or push/pop(test ignored in summary) [source code](./test/performance_pop_versus_change_priority.rb)
|
390
|
+
Start with 500 pushes, then:
|
391
|
+
* If queue supports changing priority 500 change_priority calls, then 500 pops
|
392
|
+
* If does not support changing priority 500 push calls, then 1000 pops
|
389
393
|
<table>
|
390
394
|
<tr>
|
391
|
-
<th colspan="4">ruby 3.1.
|
395
|
+
<th colspan="4">ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-darwin21]</th>
|
392
396
|
</tr>
|
393
397
|
<tr>
|
394
398
|
<th>Library</th>
|
395
399
|
<th>Iterations per second</th>
|
396
400
|
</tr>
|
397
401
|
<tr>
|
398
|
-
<td>pairing_heap</td>
|
399
|
-
<td>
|
402
|
+
<td>pairing_heap (PairingHeap)</td>
|
403
|
+
<td>436.4</td>
|
400
404
|
</tr>
|
401
405
|
<tr>
|
402
406
|
<td>lazy_priority_queue</td>
|
403
|
-
<td>
|
407
|
+
<td>380.2(1.94x slower)</td>
|
408
|
+
</tr>
|
409
|
+
<tr>
|
410
|
+
<td>pairing_heap (SimplePairingHeap)</td>
|
411
|
+
<td>339.9.02(2.17x slower)</td>
|
404
412
|
</tr>
|
405
413
|
<tr>
|
406
414
|
<td>Fibonacci</td>
|
407
|
-
<td>
|
415
|
+
<td>313.9(2.35x slower)</td>
|
416
|
+
</tr>
|
417
|
+
<tr>
|
418
|
+
<td>rb_heap</td>
|
419
|
+
<td>194.7(3.78 slower)</td>
|
408
420
|
</tr>
|
409
421
|
<tr>
|
410
|
-
<th colspan="4">ruby 3.1.
|
422
|
+
<th colspan="4">ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) +YJIT [x86_64-darwin21]</th>
|
411
423
|
</tr>
|
412
424
|
<tr>
|
413
425
|
<th>Library</th>
|
@@ -415,60 +427,84 @@ A stress test of 165 operations: starting with 10 pushes/10 change_priorities/0
|
|
415
427
|
</tr>
|
416
428
|
<tr>
|
417
429
|
<td>pairing_heap</td>
|
418
|
-
<td>
|
430
|
+
<td>854.6</td>
|
419
431
|
</tr>
|
420
432
|
<tr>
|
421
433
|
<td>Fibonacci</td>
|
422
|
-
<td>
|
434
|
+
<td>651.3(1.31x slower)</td>
|
423
435
|
</tr>
|
424
436
|
<tr>
|
425
437
|
<td>lazy_priority_queue</td>
|
426
|
-
<td>
|
438
|
+
<td>453.6(1.88x slower)</td>
|
427
439
|
</tr>
|
428
440
|
<tr>
|
429
|
-
<
|
441
|
+
<td>pairing_heap(SimplePairingHeap)</td>
|
442
|
+
<td>390.9(2.19x slower)</td>
|
443
|
+
</tr>
|
444
|
+
<tr>
|
445
|
+
<td>rb_heap</td>
|
446
|
+
<td>268.8(3.18x slower)</td>
|
447
|
+
</tr>
|
448
|
+
<tr>
|
449
|
+
<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
450
|
</tr>
|
431
451
|
<tr>
|
432
452
|
<th>Library</th>
|
433
453
|
<th>Iterations per second</th>
|
434
454
|
</tr>
|
435
455
|
<tr>
|
436
|
-
<td>pairing_heap</td>
|
437
|
-
<td>
|
456
|
+
<td>pairing_heap(PairingHeap)</td>
|
457
|
+
<td>1591</td>
|
458
|
+
</tr>
|
459
|
+
<tr>
|
460
|
+
<td>Fibonacci</td>
|
461
|
+
<td>1092(1.46x slower)</td>
|
438
462
|
</tr>
|
439
463
|
<tr>
|
440
464
|
<td>lazy_priority_queue</td>
|
441
|
-
<td>
|
465
|
+
<td>986(1.61x slower)</td>
|
442
466
|
</tr>
|
443
467
|
<tr>
|
444
|
-
<td>
|
445
|
-
<td>
|
468
|
+
<td>pairing_heap(SimplePairingHeap)</td>
|
469
|
+
<td>562(2.37x slower)</td>
|
470
|
+
</tr>
|
471
|
+
<tr>
|
472
|
+
<td>rb_heap</td>
|
473
|
+
<td>623(2.55x slower)</td>
|
446
474
|
</tr>
|
447
475
|
<tr>
|
448
|
-
<th colspan="4">
|
476
|
+
<th colspan="4">truffleruby 22.2.0, like ruby 3.0.3, GraalVM CE JVM [x86_64-darwin]</th>
|
449
477
|
</tr>
|
450
478
|
<tr>
|
451
479
|
<th>Library</th>
|
452
480
|
<th>Iterations per second</th>
|
453
481
|
</tr>
|
454
482
|
<tr>
|
455
|
-
<td>pairing_heap</td>
|
456
|
-
<td>
|
483
|
+
<td>pairing_heap(PairingHeap)</td>
|
484
|
+
<td>7404</td>
|
485
|
+
</tr>
|
486
|
+
<tr>
|
487
|
+
<td>pairing_heap(SimplePairingHeap)</td>
|
488
|
+
<td>5104(1.45x slower)</td>
|
489
|
+
</tr>
|
490
|
+
<tr>
|
491
|
+
<td>rb_heap</td>
|
492
|
+
<td>1575(4.70x slower)</td>
|
457
493
|
</tr>
|
458
494
|
<tr>
|
459
495
|
<td>Fibonacci</td>
|
460
|
-
<td>
|
496
|
+
<td>1258(5.88x slower)</td>
|
461
497
|
</tr>
|
462
498
|
<tr>
|
463
499
|
<td>lazy_priority_queue</td>
|
464
|
-
<td>
|
500
|
+
<td>1004(7.38x slower)</td>
|
465
501
|
</tr>
|
466
502
|
</table>
|
467
503
|
|
468
504
|
### Dijkstra's algorithm with RGL [source code](./test/performance_rgl.rb)
|
469
505
|
<table>
|
470
506
|
<tr>
|
471
|
-
<th colspan="4">ruby 3.1.
|
507
|
+
<th colspan="4">ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-darwin21]</th>
|
472
508
|
</tr>
|
473
509
|
<tr>
|
474
510
|
<th>Library</th>
|
@@ -479,23 +515,23 @@ A stress test of 165 operations: starting with 10 pushes/10 change_priorities/0
|
|
479
515
|
<tr>
|
480
516
|
<td>pairing_heap</td>
|
481
517
|
<td>9</td>
|
482
|
-
<td>
|
483
|
-
<td>0.
|
518
|
+
<td>61.469343</td>
|
519
|
+
<td>0.116</td>
|
484
520
|
</tr>
|
485
521
|
<tr>
|
486
522
|
<td>lazy_priority_queue</td>
|
487
523
|
<td>8</td>
|
488
|
-
<td>
|
489
|
-
<td>0.125(1.
|
524
|
+
<td>64.312672</td>
|
525
|
+
<td>0.125(1.18x slower)</td>
|
490
526
|
</tr>
|
491
527
|
<tr>
|
492
528
|
<td>Fibonacci</td>
|
493
529
|
<td>7</td>
|
494
|
-
<td>
|
495
|
-
<td>0.
|
530
|
+
<td>60.555716</td>
|
531
|
+
<td>0.116(1.27x slower)</td>
|
496
532
|
</tr>
|
497
533
|
<tr>
|
498
|
-
<th colspan="4">ruby 3.1.
|
534
|
+
<th colspan="4">ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) +YJIT [x86_64-darwin21]</th>
|
499
535
|
</tr>
|
500
536
|
<tr>
|
501
537
|
<th>Library</th>
|
@@ -505,24 +541,24 @@ A stress test of 165 operations: starting with 10 pushes/10 change_priorities/0
|
|
505
541
|
</tr>
|
506
542
|
<tr>
|
507
543
|
<td>pairing_heap</td>
|
508
|
-
<td>
|
509
|
-
<td>
|
510
|
-
<td>0.
|
544
|
+
<td>10</td>
|
545
|
+
<td>65.160945s</td>
|
546
|
+
<td>0.154</td>
|
511
547
|
</tr>
|
512
548
|
<tr>
|
513
549
|
<td>Fibonacci</td>
|
514
550
|
<td>9</td>
|
515
|
-
<td>
|
516
|
-
<td>0.
|
551
|
+
<td>61.950587</td>
|
552
|
+
<td>0.145(1.06x slower)</td>
|
517
553
|
</tr>
|
518
554
|
<tr>
|
519
555
|
<td>lazy_priority_queue</td>
|
520
|
-
<td>
|
521
|
-
<td>
|
522
|
-
<td>0.
|
556
|
+
<td>9</td>
|
557
|
+
<td>66.592123</td>
|
558
|
+
<td>0.135(1.14x slower)</td>
|
523
559
|
</tr>
|
524
560
|
<tr>
|
525
|
-
<th colspan="4">jruby 9.3.
|
561
|
+
<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
562
|
</tr>
|
527
563
|
<tr>
|
528
564
|
<th>Library</th>
|
@@ -531,25 +567,25 @@ A stress test of 165 operations: starting with 10 pushes/10 change_priorities/0
|
|
531
567
|
<th>Iterations per second</th>
|
532
568
|
</tr>
|
533
569
|
<tr>
|
534
|
-
<td>
|
535
|
-
<td>
|
536
|
-
<td>
|
537
|
-
<td>0.
|
570
|
+
<td>lazy_priority_queue</td>
|
571
|
+
<td>20</td>
|
572
|
+
<td>61.149944</td>
|
573
|
+
<td>0.328</td>
|
538
574
|
</tr>
|
539
575
|
<tr>
|
540
|
-
<td>
|
541
|
-
<td>
|
542
|
-
<td>61.
|
543
|
-
<td>0.
|
576
|
+
<td>pairing_heap</td>
|
577
|
+
<td>20</td>
|
578
|
+
<td>61.210225s</td>
|
579
|
+
<td>0.328</td>
|
544
580
|
</tr>
|
545
581
|
<tr>
|
546
582
|
<td>Fibonacci</td>
|
547
|
-
<td>
|
548
|
-
<td>
|
549
|
-
<td>0.
|
583
|
+
<td>18</td>
|
584
|
+
<td>62.330882</td>
|
585
|
+
<td>0.292(1.12x slower)</td>
|
550
586
|
</tr>
|
551
587
|
<tr>
|
552
|
-
<th colspan="4">
|
588
|
+
<th colspan="4">truffleruby 22.2.0, like ruby 3.0.3, GraalVM CE JVM [x86_64-darwin]</th>
|
553
589
|
</tr>
|
554
590
|
<tr>
|
555
591
|
<th>Library</th>
|
@@ -559,21 +595,21 @@ A stress test of 165 operations: starting with 10 pushes/10 change_priorities/0
|
|
559
595
|
</tr>
|
560
596
|
<tr>
|
561
597
|
<td>pairing_heap</td>
|
562
|
-
<td>
|
563
|
-
<td>
|
564
|
-
<td>0.
|
598
|
+
<td>59</td>
|
599
|
+
<td>60.053843</td>
|
600
|
+
<td>0.991</td>
|
565
601
|
</tr>
|
566
602
|
<tr>
|
567
|
-
<td>
|
568
|
-
<td>
|
569
|
-
<td>
|
570
|
-
<td>0.
|
603
|
+
<td>lazy_priority_queue</td>
|
604
|
+
<td>34</td>
|
605
|
+
<td>60.586461</td>
|
606
|
+
<td>0.563(1.76x slower)</td>
|
571
607
|
</tr>
|
572
608
|
<tr>
|
573
|
-
<td>
|
574
|
-
<td>
|
575
|
-
<td>60.
|
576
|
-
<td>0.
|
609
|
+
<td>Fibonacci</td>
|
610
|
+
<td>31</td>
|
611
|
+
<td>60.633711</td>
|
612
|
+
<td>0.520(1.90x slower)</td>
|
577
613
|
</tr>
|
578
614
|
</table>
|
579
615
|
|
@@ -581,7 +617,7 @@ A stress test of 165 operations: starting with 10 pushes/10 change_priorities/0
|
|
581
617
|
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
618
|
<table>
|
583
619
|
<tr>
|
584
|
-
<th colspan="4">ruby 3.1.
|
620
|
+
<th colspan="4">ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-darwin21]</th>
|
585
621
|
</tr>
|
586
622
|
<tr>
|
587
623
|
<th>Library</th>
|
@@ -591,36 +627,36 @@ Heaps that support change_priority operation use it. Heaps that do not support i
|
|
591
627
|
</tr>
|
592
628
|
<tr>
|
593
629
|
<td>pairing_heap (SimplePairingHeap)</td>
|
594
|
-
<td>
|
595
|
-
<td>
|
596
|
-
<td>0.
|
630
|
+
<td>28</td>
|
631
|
+
<td>62.100299</td>
|
632
|
+
<td>0.451</td>
|
597
633
|
</tr>
|
598
634
|
<tr>
|
599
635
|
<td>pairing_heap (PairingHeap)</td>
|
600
|
-
<td>
|
601
|
-
<td>
|
602
|
-
<td>0.
|
636
|
+
<td>23</td>
|
637
|
+
<td>60.633153</td>
|
638
|
+
<td>0.380(1.19x slower)</td>
|
603
639
|
</tr>
|
604
640
|
<tr>
|
605
641
|
<td>rb_heap</td>
|
606
|
-
<td>
|
607
|
-
<td>
|
608
|
-
<td>0.
|
642
|
+
<td>14</td>
|
643
|
+
<td>62.019763</td>
|
644
|
+
<td>0.226(2.00x slower)</td>
|
609
645
|
</tr>
|
610
646
|
<tr>
|
611
647
|
<td>lazy_priority_queue</td>
|
612
|
-
<td>
|
613
|
-
<td>
|
614
|
-
<td>0.
|
648
|
+
<td>11</td>
|
649
|
+
<td>63.105064s</td>
|
650
|
+
<td>0.174(2.58x slower)</td>
|
615
651
|
</tr>
|
616
652
|
<tr>
|
617
653
|
<td>Fibonacci</td>
|
618
654
|
<td>10</td>
|
619
|
-
<td>
|
620
|
-
<td>0.
|
655
|
+
<td>64.407187</td>
|
656
|
+
<td>0.155(2.90x slower)</td>
|
621
657
|
</tr>
|
622
658
|
<tr>
|
623
|
-
<th colspan="4">ruby 3.1.
|
659
|
+
<th colspan="4">ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) +YJIT [x86_64-darwin21]</th>
|
624
660
|
</tr>
|
625
661
|
<tr>
|
626
662
|
<th>Library</th>
|
@@ -630,36 +666,36 @@ Heaps that support change_priority operation use it. Heaps that do not support i
|
|
630
666
|
</tr>
|
631
667
|
<tr>
|
632
668
|
<td>pairing_heap (SimplePairingHeap)</td>
|
633
|
-
<td>
|
634
|
-
<td>61.
|
635
|
-
<td>0.
|
669
|
+
<td>32</td>
|
670
|
+
<td>61.289321</td>
|
671
|
+
<td>0.522</td>
|
636
672
|
</tr>
|
637
673
|
<tr>
|
638
674
|
<td>pairing_heap (PairingHeap)</td>
|
639
|
-
<td>
|
640
|
-
<td>
|
641
|
-
<td>0.
|
675
|
+
<td>26</td>
|
676
|
+
<td>60.657625</td>
|
677
|
+
<td>0.429(1.22x slower)</td>
|
642
678
|
</tr>
|
643
679
|
<tr>
|
644
680
|
<td>rb_heap</td>
|
645
681
|
<td>19</td>
|
646
|
-
<td>
|
647
|
-
<td>0.
|
682
|
+
<td>60.710888s</td>
|
683
|
+
<td>0.313(1.67x slower)</td>
|
648
684
|
</tr>
|
649
685
|
<tr>
|
650
686
|
<td>Fibonacci</td>
|
651
|
-
<td>
|
652
|
-
<td>
|
653
|
-
<td>0.
|
687
|
+
<td>19</td>
|
688
|
+
<td>61.471203</td>
|
689
|
+
<td>0.310(1.69x slower)</td>
|
654
690
|
</tr>
|
655
691
|
<tr>
|
656
692
|
<td>lazy_priority_queue</td>
|
657
693
|
<td>12</td>
|
658
|
-
<td>60.
|
659
|
-
<td>0.
|
694
|
+
<td>60.125779</td>
|
695
|
+
<td>0.200(2.61x slower)</td>
|
660
696
|
</tr>
|
661
697
|
<tr>
|
662
|
-
<th colspan="4">jruby 9.3.
|
698
|
+
<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
699
|
</tr>
|
664
700
|
<tr>
|
665
701
|
<th>Library</th>
|
@@ -669,36 +705,36 @@ Heaps that support change_priority operation use it. Heaps that do not support i
|
|
669
705
|
</tr>
|
670
706
|
<tr>
|
671
707
|
<td>pairing_heap (SimplePairingHeap)</td>
|
672
|
-
<td>
|
673
|
-
<td>61.
|
674
|
-
<td>0.
|
708
|
+
<td>46</td>
|
709
|
+
<td>61.226924</td>
|
710
|
+
<td>0.753</td>
|
675
711
|
</tr>
|
676
712
|
<tr>
|
677
|
-
<td>
|
678
|
-
<td>
|
679
|
-
<td>
|
680
|
-
<td>0.
|
713
|
+
<td>rb_heap</td>
|
714
|
+
<td>38</td>
|
715
|
+
<td>60.563995</td>
|
716
|
+
<td>0.628(1.20x slower)</td>
|
681
717
|
</tr>
|
682
718
|
<tr>
|
683
|
-
<td>
|
684
|
-
<td>
|
685
|
-
<td>
|
686
|
-
<td>0.
|
719
|
+
<td>pairing_heap (PairingHeap)</td>
|
720
|
+
<td>37</td>
|
721
|
+
<td>60.928350</td>
|
722
|
+
<td>0.608(1.24x slower)</td>
|
687
723
|
</tr>
|
688
724
|
<tr>
|
689
|
-
<td>
|
690
|
-
<td>
|
691
|
-
<td>
|
692
|
-
<td>0.
|
725
|
+
<td>Fibonacci</td>
|
726
|
+
<td>28</td>
|
727
|
+
<td>61.136970</td>
|
728
|
+
<td>0.461(1.63x slower)</td>
|
693
729
|
</tr>
|
694
730
|
<tr>
|
695
|
-
<td>
|
696
|
-
<td>
|
697
|
-
<td>62.
|
698
|
-
<td>0.
|
731
|
+
<td>lazy_priority_queue</td>
|
732
|
+
<td>22</td>
|
733
|
+
<td>62.214796</td>
|
734
|
+
<td>0.354(2.13x slower)</td>
|
699
735
|
</tr>
|
700
736
|
<tr>
|
701
|
-
<th colspan="4">
|
737
|
+
<th colspan="4">truffleruby 22.2.0, like ruby 3.0.3, GraalVM CE JVM [x86_64-darwin]</th>
|
702
738
|
</tr>
|
703
739
|
<tr>
|
704
740
|
<th>Library</th>
|
@@ -708,33 +744,33 @@ Heaps that support change_priority operation use it. Heaps that do not support i
|
|
708
744
|
</tr>
|
709
745
|
<tr>
|
710
746
|
<td>pairing_heap (SimplePairingHeap)</td>
|
711
|
-
<td>
|
712
|
-
<td>
|
713
|
-
<td>
|
747
|
+
<td>176</td>
|
748
|
+
<td>60.029817</td>
|
749
|
+
<td>3.006</td>
|
714
750
|
</tr>
|
715
751
|
<tr>
|
716
|
-
<td>
|
717
|
-
<td>
|
718
|
-
<td>
|
719
|
-
<td>
|
752
|
+
<td>pairing_heap (PairingHeap)</td>
|
753
|
+
<td>124</td>
|
754
|
+
<td>60.366607</td>
|
755
|
+
<td>2.078(1.45x slower)</td>
|
720
756
|
</tr>
|
721
757
|
<tr>
|
722
|
-
<td>
|
723
|
-
<td>
|
724
|
-
<td>60.
|
725
|
-
<td>
|
758
|
+
<td>rb_heap</td>
|
759
|
+
<td>95</td>
|
760
|
+
<td>60.021043</td>
|
761
|
+
<td>1.585(1.90x slower)</td>
|
726
762
|
</tr>
|
727
763
|
<tr>
|
728
764
|
<td>Fibonacci</td>
|
729
|
-
<td>
|
730
|
-
<td>
|
731
|
-
<td>0.
|
765
|
+
<td>38</td>
|
766
|
+
<td>60.020976</td>
|
767
|
+
<td>0.636(4.72x slower)</td>
|
732
768
|
</tr>
|
733
769
|
<tr>
|
734
770
|
<td>lazy_priority_queue</td>
|
735
|
-
<td>
|
736
|
-
<td>
|
737
|
-
<td>0.
|
771
|
+
<td>27</td>
|
772
|
+
<td>61.349925</td>
|
773
|
+
<td>0.445(6.75x slower)</td>
|
738
774
|
</tr>
|
739
775
|
</table>
|
740
776
|
|
@@ -742,7 +778,7 @@ Heaps that support change_priority operation use it. Heaps that do not support i
|
|
742
778
|
#### Change priority required
|
743
779
|
<table>
|
744
780
|
<tr>
|
745
|
-
<th colspan="4">ruby 3.1.
|
781
|
+
<th colspan="4">ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-darwin21]</th>
|
746
782
|
</tr>
|
747
783
|
<tr>
|
748
784
|
<th>Library</th>
|
@@ -754,14 +790,14 @@ Heaps that support change_priority operation use it. Heaps that do not support i
|
|
754
790
|
</tr>
|
755
791
|
<tr>
|
756
792
|
<td>lazy_priority_queue</td>
|
757
|
-
<td>1.
|
793
|
+
<td>1.688x slower</td>
|
758
794
|
</tr>
|
759
795
|
<tr>
|
760
796
|
<td>Fibonacci</td>
|
761
|
-
<td>1.
|
797
|
+
<td>1.987x slower</td>
|
762
798
|
</tr>
|
763
799
|
<tr>
|
764
|
-
<th colspan="4">ruby 3.1.
|
800
|
+
<th colspan="4">ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) +YJIT [x86_64-darwin21]</th>
|
765
801
|
</tr>
|
766
802
|
<tr>
|
767
803
|
<th>Library</th>
|
@@ -773,14 +809,14 @@ Heaps that support change_priority operation use it. Heaps that do not support i
|
|
773
809
|
</tr>
|
774
810
|
<tr>
|
775
811
|
<td>Fibonacci</td>
|
776
|
-
<td>1.
|
812
|
+
<td>1.256x slower</td>
|
777
813
|
</tr>
|
778
814
|
<tr>
|
779
815
|
<td>lazy_priority_queue</td>
|
780
|
-
<td>1.
|
816
|
+
<td>1.648x slower</td>
|
781
817
|
</tr>
|
782
818
|
<tr>
|
783
|
-
<th colspan="4">jruby 9.3.
|
819
|
+
<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
820
|
</tr>
|
785
821
|
<tr>
|
786
822
|
<th>Library</th>
|
@@ -791,16 +827,15 @@ Heaps that support change_priority operation use it. Heaps that do not support i
|
|
791
827
|
<td>1</td>
|
792
828
|
</tr>
|
793
829
|
<tr>
|
794
|
-
<td>
|
795
|
-
<td>1.
|
796
|
-
|
830
|
+
<td>Fibonacci</td>
|
831
|
+
<td>1.327x slower</td>
|
797
832
|
</tr>
|
798
833
|
<tr>
|
799
|
-
<td>
|
800
|
-
<td>1.
|
834
|
+
<td>lazy_priority_queue</td>
|
835
|
+
<td>1.383x slower</td>
|
801
836
|
</tr>
|
802
837
|
<tr>
|
803
|
-
<th colspan="4">
|
838
|
+
<th colspan="4">truffleruby 22.2.0, like ruby 3.0.3, GraalVM CE JVM [x86_64-darwin]</th>
|
804
839
|
</tr>
|
805
840
|
<tr>
|
806
841
|
<th>Library</th>
|
@@ -811,19 +846,19 @@ Heaps that support change_priority operation use it. Heaps that do not support i
|
|
811
846
|
<td>1</td>
|
812
847
|
</tr>
|
813
848
|
<tr>
|
814
|
-
<td>
|
815
|
-
<td>
|
849
|
+
<td>lazy_priority_queue</td>
|
850
|
+
<td>3.878x slower</td>
|
816
851
|
</tr>
|
817
852
|
<tr>
|
818
|
-
<td>
|
819
|
-
<td>
|
853
|
+
<td>Fibonacci</td>
|
854
|
+
<td>9.889x slower</td>
|
820
855
|
</tr>
|
821
856
|
</table>
|
822
857
|
|
823
858
|
#### Change priority not required
|
824
859
|
<table>
|
825
860
|
<tr>
|
826
|
-
<th colspan="4">ruby 3.1.
|
861
|
+
<th colspan="4">ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-darwin21]</th>
|
827
862
|
</tr>
|
828
863
|
<tr>
|
829
864
|
<th>Library</th>
|
@@ -835,22 +870,22 @@ Heaps that support change_priority operation use it. Heaps that do not support i
|
|
835
870
|
</tr>
|
836
871
|
<tr>
|
837
872
|
<td>pairing_heap (PairingHeap)</td>
|
838
|
-
<td>1.
|
873
|
+
<td>1.318x slower</td>
|
839
874
|
</tr>
|
840
875
|
<tr>
|
841
876
|
<td>rb_heap</td>
|
842
|
-
<td>1.
|
877
|
+
<td>1.8x slower</td>
|
843
878
|
</tr>
|
844
879
|
<tr>
|
845
880
|
<td>lazy_priority_queue</td>
|
846
|
-
<td>2.
|
881
|
+
<td>2.519x slower</td>
|
847
882
|
</tr>
|
848
883
|
<tr>
|
849
884
|
<td>Fibonacci</td>
|
850
|
-
<td>2.
|
885
|
+
<td>2.989x slower</td>
|
851
886
|
</tr>
|
852
887
|
<tr>
|
853
|
-
<th colspan="4">ruby 3.1.
|
888
|
+
<th colspan="4">ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) +YJIT [x86_64-darwin21]</th>
|
854
889
|
</tr>
|
855
890
|
<tr>
|
856
891
|
<th>Library</th>
|
@@ -862,22 +897,22 @@ Heaps that support change_priority operation use it. Heaps that do not support i
|
|
862
897
|
</tr>
|
863
898
|
<tr>
|
864
899
|
<td>pairing_heap (PairingHeap)</td>
|
865
|
-
<td>1.
|
900
|
+
<td>1.348x slower</td>
|
866
901
|
</tr>
|
867
902
|
<tr>
|
868
|
-
<td>
|
869
|
-
<td>1.
|
903
|
+
<td>rb_heap</td>
|
904
|
+
<td>1.490x slower</td>
|
870
905
|
</tr>
|
871
906
|
<tr>
|
872
|
-
<td>
|
873
|
-
<td>1.
|
907
|
+
<td>Fibonacci</td>
|
908
|
+
<td>1.792x slower</td>
|
874
909
|
</tr>
|
875
910
|
<tr>
|
876
911
|
<td>lazy_priority_queue</td>
|
877
|
-
<td>2.
|
912
|
+
<td>2.492x slower</td>
|
878
913
|
</tr>
|
879
914
|
<tr>
|
880
|
-
<th colspan="4">jruby 9.3.
|
915
|
+
<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
916
|
</tr>
|
882
917
|
<tr>
|
883
918
|
<th>Library</th>
|
@@ -888,23 +923,23 @@ Heaps that support change_priority operation use it. Heaps that do not support i
|
|
888
923
|
<td>1</td>
|
889
924
|
</tr>
|
890
925
|
<tr>
|
891
|
-
<td>
|
892
|
-
<td>1.
|
926
|
+
<td>rb_heap</td>
|
927
|
+
<td>1.292x slower</td>
|
893
928
|
</tr>
|
894
929
|
<tr>
|
895
|
-
<td>
|
896
|
-
<td>1.
|
930
|
+
<td>pairing_heap (PairingHeap)</td>
|
931
|
+
<td>1.359x slower</td>
|
897
932
|
</tr>
|
898
933
|
<tr>
|
899
|
-
<td>
|
900
|
-
<td>
|
934
|
+
<td>lazy_priority_queue</td>
|
935
|
+
<td>2.115x slower</td>
|
901
936
|
</tr>
|
902
937
|
<tr>
|
903
938
|
<td>Fibonacci</td>
|
904
|
-
<td>
|
939
|
+
<td>1.824x slower</td>
|
905
940
|
</tr>
|
906
941
|
<tr>
|
907
|
-
<th colspan="4">
|
942
|
+
<th colspan="4">truffleruby 22.2.0, like ruby 3.0.3, GraalVM CE JVM [x86_64-darwin]</th>
|
908
943
|
</tr>
|
909
944
|
<tr>
|
910
945
|
<th>Library</th>
|
@@ -916,19 +951,19 @@ Heaps that support change_priority operation use it. Heaps that do not support i
|
|
916
951
|
</tr>
|
917
952
|
<tr>
|
918
953
|
<td>pairing_heap (PairingHeap)</td>
|
919
|
-
<td>1.
|
954
|
+
<td>1.865x slower</td>
|
920
955
|
</tr>
|
921
956
|
<tr>
|
922
957
|
<td>rb_heap</td>
|
923
|
-
<td>1.
|
958
|
+
<td>1.915x slower</td>
|
924
959
|
</tr>
|
925
960
|
<tr>
|
926
|
-
<td>
|
927
|
-
<td>
|
961
|
+
<td>lazy_priority_queue</td>
|
962
|
+
<td>8.791x slower</td>
|
928
963
|
</tr>
|
929
964
|
<tr>
|
930
|
-
<td>
|
931
|
-
<td>
|
965
|
+
<td>Fibonacci</td>
|
966
|
+
<td>26.044x slower</td>
|
932
967
|
</tr>
|
933
968
|
</table>
|
934
969
|
|