commit rubygem-pairing_heap for openSUSE:Factory
24 Jun
2024
24 Jun
'24
18:52
Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package rubygem-pairing_heap for openSUSE:Factory checked in at 2024-06-24 20:51:17 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-pairing_heap (Old) and /work/SRC/openSUSE:Factory/.rubygem-pairing_heap.new.18349 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "rubygem-pairing_heap" Mon Jun 24 20:51:17 2024 rev:4 rq:1182816 version:3.1.0 Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-pairing_heap/rubygem-pairing_heap.changes 2023-11-05 12:18:53.821364032 +0100 +++ /work/SRC/openSUSE:Factory/.rubygem-pairing_heap.new.18349/rubygem-pairing_heap.changes 2024-06-24 20:52:16.710083306 +0200 @@ -1,0 +2,9 @@ +Fri Jun 21 10:21:28 UTC 2024 - Dan Čermák <dan.cermak@posteo.net> + +- 3.1.0: + +* Implement merge operation for SimplePairingHeap + + + +------------------------------------------------------------------- Old: ---- pairing_heap-3.0.1.gem New: ---- pairing_heap-3.1.0.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-pairing_heap.spec ++++++ --- /var/tmp/diff_new_pack.OM9cGV/_old 2024-06-24 20:52:17.294104654 +0200 +++ /var/tmp/diff_new_pack.OM9cGV/_new 2024-06-24 20:52:17.298104801 +0200 @@ -1,7 +1,7 @@ # # spec file for package rubygem-pairing_heap # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,7 +24,7 @@ # Name: rubygem-pairing_heap -Version: 3.0.1 +Version: 3.1.0 Release: 0 %define mod_name pairing_heap %define mod_full_name %{mod_name}-%{version} ++++++ pairing_heap-3.0.1.gem -> pairing_heap-3.1.0.gem ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/.github/workflows/main.yml new/.github/workflows/main.yml --- old/.github/workflows/main.yml 2023-04-09 15:46:33.000000000 +0200 +++ new/.github/workflows/main.yml 2024-02-11 16:03:25.000000000 +0100 @@ -8,7 +8,7 @@ matrix: os: [ubuntu-latest, macos-latest] # Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0' - ruby: ['2.7', '3.0', '3.1', '3.2', head, jruby, jruby-head, truffleruby, truffleruby-head] + ruby: ['2.7', '3.0', '3.1', '3.2', '3.3', head, jruby, jruby-head, truffleruby, truffleruby-head] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Gemfile.lock new/Gemfile.lock --- old/Gemfile.lock 2023-04-09 15:46:33.000000000 +0200 +++ new/Gemfile.lock 2024-02-11 16:03:25.000000000 +0100 @@ -1,51 +1,66 @@ PATH remote: . specs: - pairing_heap (3.0.1) + pairing_heap (3.1.0) GEM remote: https://rubygems.org/ specs: ast (2.4.2) + base64 (0.1.1) docile (1.4.0) json (2.6.3) json (2.6.3-java) - language_server-protocol (3.17.0.2) - minitest (5.15.0) - parallel (1.22.1) - parser (3.1.3.0) + language_server-protocol (3.17.0.3) + lint_roller (1.1.0) + minitest (5.21.2) + parallel (1.23.0) + parser (3.2.2.3) ast (~> 2.4.1) + racc + racc (1.7.1) + racc (1.7.1-java) rainbow (3.1.1) rake (13.0.6) - regexp_parser (2.6.1) - rexml (3.2.5) - rubocop (1.40.0) + regexp_parser (2.8.1) + rexml (3.2.6) + rubocop (1.56.3) + base64 (~> 0.1.1) json (~> 2.3) + language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.1.2.1) + parser (>= 3.2.2.3) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.23.0, < 2.0) + rubocop-ast (>= 1.28.1, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.24.0) - parser (>= 3.1.1.0) - rubocop-performance (1.15.1) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.29.0) + parser (>= 3.2.1.0) + rubocop-performance (1.19.0) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) - ruby-progressbar (1.11.0) + ruby-progressbar (1.13.0) simplecov (0.22.0) docile (~> 1.1) simplecov-html (~> 0.11) simplecov_json_formatter (~> 0.1) simplecov-html (0.12.3) simplecov_json_formatter (0.1.4) - standard (1.20.0) + standard (1.31.1) language_server-protocol (~> 3.17.0.2) - rubocop (= 1.40.0) - rubocop-performance (= 1.15.1) - unicode-display_width (2.3.0) + lint_roller (~> 1.0) + rubocop (~> 1.56.2) + standard-custom (~> 1.0.0) + standard-performance (~> 1.2) + standard-custom (1.0.2) + lint_roller (~> 1.0) + rubocop (~> 1.50) + standard-performance (1.2.0) + lint_roller (~> 1.1) + rubocop-performance (~> 1.19.0) + unicode-display_width (2.4.2) PLATFORMS universal-java-17 @@ -53,14 +68,15 @@ x86_64-darwin-20 x86_64-darwin-21 x86_64-darwin-22 + x86_64-darwin-23 x86_64-linux DEPENDENCIES - minitest (~> 5.0) + minitest (~> 5.21) pairing_heap! rake (~> 13.0) simplecov (~> 0.22.0) - standard (~> 1.20) + standard (~> 1.31) BUNDLED WITH 2.3.6 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/README.md new/README.md --- old/README.md 2023-04-09 15:46:33.000000000 +0200 +++ new/README.md 2024-02-11 16:03:25.000000000 +0100 @@ -101,9 +101,12 @@ | dequeue | O(n) | O(log n) | | * change_priority | O(1) | o(log n) | | * delete | O(n) | O(log n) | +| ^ merge | O(1) | O(1) | `*` Not available in `SimplePairingHeap` +`^` Only available in `SimplePairingHeap` + ## Benchmarks I picked the three fastest pure Ruby priority queue implementations I was aware of for the comparison: @@ -117,7 +120,7 @@ > 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. <table> <tr> - <th colspan="4">ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-darwin21]</th> + <th colspan="4">ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-darwin23]</th> </tr> <tr> <th>Library</th> @@ -127,36 +130,36 @@ </tr> <tr> <td>pairing_heap (SimplePairingHeap)</td> - <td>23</td> - <td>62.014773</td> - <td>0.371</td> + <td>26</td> + <td>62.249427</td> + <td>0.419</td> </tr> <tr> <td>pairing_heap (PairingHeap)</td> - <td>16</td> - <td>63.135240</td> - <td>0.253(1.46x slower)</td> + <td>17</td> + <td>61.624806</td> + <td>0.276(1.52x slower)</td> </tr> <tr> <td>rb_heap</td> - <td>14</td> - <td>61.123304</td> - <td>0.229(1.62x slower)</td> + <td>16</td> + <td>63.656502</td> + <td>0.251(1.67x slower)</td> </tr> <tr> <td>lazy_priority_queue</td> - <td>10</td> - <td>66.208647</td> - <td>0.151(2.46x slower)</td> + <td>7</td> + <td>63.339192</td> + <td>0.111(3.79x slower)</td> </tr> <tr> <td>Fibonacci</td> - <td>8</td> - <td>66.353147</td> - <td>0.121(3.08x slower)</td> + <td>5</td> + <td>69.010737</td> + <td>0.073(5.77x slower)</td> </tr> <tr> - <th colspan="4">ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) +YJIT [x86_64-darwin21]</th> + <th colspan="4">ruby 3.3.0 (2023-12-25 revision 5124f9ac75) +YJIT [x86_64-darwin23]</th> </tr> <tr> <th>Library</th> @@ -166,36 +169,36 @@ </tr> <tr> <td>pairing_heap (SimplePairingHeap)</td> - <td>25</td> - <td>60.423579</td> - <td>0.414</td> + <td>39</td> + <td>60.725689</td> + <td>0.642</td> </tr> <tr> <td>rb_heap</td> - <td>19</td> - <td>60.869907</td> - <td>0.312(1.33x slower)</td> + <td>31</td> + <td>60.370348</td> + <td>0.514(1.25x slower)</td> </tr> <tr> <td>pairing_heap (PairingHeap)</td> - <td>17</td> - <td>61.389127</td> - <td>0.277(1.49x slower)</td> + <td>25</td> + <td>62.269577</td> + <td>0.402(1.6x slower)</td> </tr> <tr> - <td>Fibonacci</td> - <td>14</td> - <td>64.417807</td> - <td>0.217(1.90x slower)</td> + <td>lazy_priority_queue</td> + <td>9</td> + <td>62.144710</td> + <td>0.145(4.43x slower)</td> </tr> <tr> - <td>lazy_priority_queue</td> - <td>11</td> - <td>63.151856</td> - <td>0.174(2.38x slower)</td> + <td>Fibonacci</td> + <td>8</td> + <td>65.064385</td> + <td>0.123(5.22x slower)</td> </tr> <tr> - <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> + <th colspan="4">jruby 9.4.5.0 (3.1.4) 2023-11-02 1abae2700f OpenJDK 64-Bit Server VM 21+35-2513 on 21+35-2513 +indy +jit [x86_64-darwin]</th> </tr> <tr> <th>Library</th> @@ -205,36 +208,36 @@ </tr> <tr> <td>pairing_heap (SimplePairingHeap)</td> - <td>47</td> - <td>60.391633</td> - <td>0.778</td> + <td>43</td> + <td>60.734661</td> + <td>0.709</td> </tr> <tr> <td>rb_heap</td> <td>34</td> - <td>60.878639</td> - <td>0.559(1.39x slower)</td> + <td>61.677228</td> + <td>0.552(1.28x slower)</td> </tr> <tr> <td>pairing_heap (PairingHeap)</td> - <td>32</td> - <td>61.211985</td> - <td>0.523(1.49x slower)</td> + <td>28</td> + <td>61.284382</td> + <td>0.458(1.55x slower)</td> </tr> <tr> <td>Fibonacci</td> - <td>23</td> - <td>60.297670</td> - <td>0.382(2.04x slower)</td> + <td>22</td> + <td>61.396897</td> + <td>0.359(1.97x slower)</td> </tr> <tr> <td>lazy_priority_queue</td> - <td>23</td> - <td>61.973538</td> - <td>0.371(2.10x slower)</td> + <td>20</td> + <td>61.841463</td> + <td>0.324(2.19x slower)</td> </tr> <tr> - <th colspan="4">truffleruby 22.2.0, like ruby 3.0.3, GraalVM CE JVM [x86_64-darwin]</th> + <th colspan="4">truffleruby 23.1.2, like ruby 3.2.2, Oracle GraalVM JVM [x86_64-darwin]</th> </tr> <tr> <th>Library</th> @@ -244,33 +247,33 @@ </tr> <tr> <td>pairing_heap (SimplePairingHeap)</td> - <td>206</td> - <td>60.191686</td> - <td>3.433</td> + <td>202</td> + <td>60.225639</td> + <td>3.388</td> </tr> <tr> <td>rb_heap</td> - <td>97</td> - <td>60.134011</td> - <td>1.614(1.93x slower)</td> + <td>140</td> + <td>60.190881</td> + <td>2.357(1.44x slower)</td> </tr> <tr> <td>pairing_heap (PairingHeap)</td> - <td>85</td> - <td>60.193608s</td> - <td>1.434(2.40x slower)</td> + <td>100</td> + <td>60.373610</td> + <td>1.692(2x slower)</td> </tr> <tr> <td>lazy_priority_queue</td> - <td>19</td> - <td>63.212429</td> - <td>0.301(11.45x slower)</td> + <td>31</td> + <td>61.179244</td> + <td>0.510(6.65x slower)</td> </tr> <tr> <td>Fibonacci</td> - <td>2</td> - <td>83.508571</td> - <td>0.024(143.70x slower)</td> + <td>11</td> + <td>64.413419</td> + <td>0.171(19.81x slower)</td> </tr> </table> @@ -278,7 +281,7 @@ 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. <table> <tr> - <th colspan="4">ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-darwin21]</th> + <th colspan="4">ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-darwin23]</th> </tr> <tr> <th>Library</th> @@ -289,23 +292,23 @@ <tr> <td>pairing_heap</td> <td>15</td> - <td>62.946988</td> - <td>0.238</td> + <td>60.817878</td> + <td>0.247</td> </tr> <tr> <td>lazy_priority_queue</td> - <td>9</td> - <td>61.876691</td> - <td>0.145(1.64x slower)</td> + <td>7</td> + <td>63.990376s</td> + <td>0.109(2.26x slower)</td> </tr> <tr> <td>Fibonacci</td> - <td>8</td> - <td>67.809982</td> - <td>0.118(2.02x slower)</td> + <td>5</td> + <td>70.148980s</td> + <td>0.071(3.47x slower)</td> </tr> <tr> - <th colspan="4">ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) +YJIT [x86_64-darwin21]</th> + <th colspan="4">ruby 3.3.0 (2023-12-25 revision 5124f9ac75) +YJIT [x86_64-darwin23]</th> </tr> <tr> <th>Library</th> @@ -315,24 +318,24 @@ </tr> <tr> <td>pairing_heap</td> - <td>16</td> - <td>62.576693</td> - <td>0.256</td> + <td>22</td> + <td>62.429264</td> + <td>0.353</td> </tr> <tr> - <td>Fibonacci</td> - <td>13</td> - <td>63.164614</td> - <td>0.206(1.24x slower)</td> + <td>lazy_priority_queue</td> + <td>9</td> + <td>63.464818</td> + <td>0.142(2.49x slower)</td> </tr> <tr> - <td>lazy_priority_queue</td> - <td>10</td> - <td>63.172995s</td> - <td>0.158(1.62x slower)</td> + <td>Fibonacci</td> + <td>8</td> + <td>67.908812</td> + <td>0.118(2.99x slower)</td> </tr> <tr> - <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> + <th colspan="4">jruby 9.4.5.0 (3.1.4) 2023-11-02 1abae2700f OpenJDK 64-Bit Server VM 21+35-2513 on 21+35-2513 +indy +jit [x86_64-darwin]</th> </tr> <tr> <th>Library</th> @@ -342,24 +345,24 @@ </tr> <tr> <td>pairing_heap</td> - <td>28</td> - <td>60.280368</td> - <td>0.465</td> + <td>27</td> + <td>61.709517</td> + <td>0.438</td> </tr> <tr> <td>Fibonacci</td> - <td>22</td> - <td>61.405561</td> - <td>0.465(1.30x slower)</td> + <td>20</td> + <td>61.495636</td> + <td>0.326(1.34x slower)</td> </tr> <tr> <td>lazy_priority_queue</td> - <td>20</td> - <td>60.397535</td> - <td>0.331(1.40x slower)</td> + <td>19</td> + <td>63.401601</td> + <td>0.309(1.46x slower)</td> </tr> <tr> - <th colspan="4">truffleruby 22.2.0, like ruby 3.0.3, GraalVM CE JVM [x86_64-darwin]</th> + <th colspan="4">truffleruby 23.1.2, like ruby 3.2.2, Oracle GraalVM JVM [x86_64-darwin]</th> </tr> <tr> <th>Library</th> @@ -369,21 +372,21 @@ </tr> <tr> <td>pairing_heap</td> - <td>70</td> - <td>60.663184</td> - <td>1.160</td> + <td>93</td> + <td>60.125750</td> + <td>1.577</td> </tr> <tr> <td>lazy_priority_queue</td> - <td>23</td> - <td>60.474587</td> - <td>0.382(3.04x slower)</td> + <td>26</td> + <td>62.372660s</td> + <td>0.419(3.77x slower)</td> </tr> <tr> <td>Fibonacci</td> - <td>2</td> - <td>74.873854</td> - <td>0.027(43.44x slower)</td> + <td>11</td> + <td>62.620172s</td> + <td>0.177(8.92x slower)</td> </tr> </table> @@ -393,7 +396,7 @@ * If does not support changing priority 500 push calls, then 1000 pops <table> <tr> - <th colspan="4">ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-darwin21]</th> + <th colspan="4">ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-darwin23]</th> </tr> <tr> <th>Library</th> @@ -401,26 +404,26 @@ </tr> <tr> <td>pairing_heap (PairingHeap)</td> - <td>436.4</td> + <td>748.9</td> </tr> <tr> <td>lazy_priority_queue</td> - <td>380.2(1.94x slower)</td> + <td>388.6(1.93x slower)</td> </tr> <tr> <td>pairing_heap (SimplePairingHeap)</td> - <td>339.9.02(2.17x slower)</td> + <td>336.2(2.23x slower)</td> </tr> <tr> <td>Fibonacci</td> - <td>313.9(2.35x slower)</td> + <td>225.9(3.31x slower)</td> </tr> <tr> <td>rb_heap</td> - <td>194.7(3.78 slower)</td> + <td>215.2(3.48x slower)</td> </tr> <tr> - <th colspan="4">ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) +YJIT [x86_64-darwin21]</th> + <th colspan="4">ruby 3.3.0 (2023-12-25 revision 5124f9ac75) +YJIT [x86_64-darwin23]</th> </tr> <tr> <th>Library</th> @@ -428,26 +431,26 @@ </tr> <tr> <td>pairing_heap</td> - <td>854.6</td> + <td>1276</td> </tr> <tr> - <td>Fibonacci</td> - <td>651.3(1.31x slower)</td> + <td>pairing_heap(SimplePairingHeap)</td> + <td>625.6(2.04x slower)</td> </tr> <tr> <td>lazy_priority_queue</td> - <td>453.6(1.88x slower)</td> + <td>533.36(2.39x slower)</td> </tr> <tr> - <td>pairing_heap(SimplePairingHeap)</td> - <td>390.9(2.19x slower)</td> + <td>Fibonacci</td> + <td>495.519(2.57x slower)</td> </tr> <tr> <td>rb_heap</td> - <td>268.8(3.18x slower)</td> + <td>453.323(2.81x slower)</td> </tr> <tr> - <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> + <th colspan="4">jruby 9.4.5.0 (3.1.4) 2023-11-02 1abae2700f OpenJDK 64-Bit Server VM 21+35-2513 on 21+35-2513 +indy +jit [x86_64-darwin]</th> </tr> <tr> <th>Library</th> @@ -455,26 +458,26 @@ </tr> <tr> <td>pairing_heap(PairingHeap)</td> - <td>1591</td> + <td>1377</td> </tr> <tr> <td>Fibonacci</td> - <td>1092(1.46x slower)</td> + <td>1088(1.27x slower)</td> </tr> <tr> <td>lazy_priority_queue</td> - <td>986(1.61x slower)</td> + <td>953.935(1.44x slower)</td> </tr> <tr> <td>pairing_heap(SimplePairingHeap)</td> - <td>562(2.37x slower)</td> + <td>621.35(2.22x slower)</td> </tr> <tr> <td>rb_heap</td> - <td>623(2.55x slower)</td> + <td>595.11(2.31x slower)</td> </tr> <tr> - <th colspan="4">truffleruby 22.2.0, like ruby 3.0.3, GraalVM CE JVM [x86_64-darwin]</th> + <th colspan="4">truffleruby 23.1.2, like ruby 3.2.2, Oracle GraalVM JVM [x86_64-darwin]</th> </tr> <tr> <th>Library</th> @@ -482,135 +485,23 @@ </tr> <tr> <td>pairing_heap(PairingHeap)</td> - <td>7404</td> + <td>12712</td> </tr> <tr> <td>pairing_heap(SimplePairingHeap)</td> - <td>5104(1.45x slower)</td> + <td>9447(1.35x slower)</td> </tr> <tr> <td>rb_heap</td> - <td>1575(4.70x slower)</td> - </tr> - <tr> - <td>Fibonacci</td> - <td>1258(5.88x slower)</td> - </tr> - <tr> - <td>lazy_priority_queue</td> - <td>1004(7.38x slower)</td> - </tr> -</table> - -### Dijkstra's algorithm with RGL [source code](./test/performance_rgl.rb) -<table> - <tr> - <th colspan="4">ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-darwin21]</th> - </tr> - <tr> - <th>Library</th> - <th>Iterations</th> - <th>Seconds</th> - <th>Iterations per second</th> - </tr> - <tr> - <td>pairing_heap</td> - <td>9</td> - <td>61.469343</td> - <td>0.116</td> - </tr> - <tr> - <td>lazy_priority_queue</td> - <td>8</td> - <td>64.312672</td> - <td>0.125(1.18x slower)</td> - </tr> - <tr> - <td>Fibonacci</td> - <td>7</td> - <td>60.555716</td> - <td>0.116(1.27x slower)</td> - </tr> - <tr> - <th colspan="4">ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) +YJIT [x86_64-darwin21]</th> - </tr> - <tr> - <th>Library</th> - <th>Iterations</th> - <th>Seconds</th> - <th>Iterations per second</th> - </tr> - <tr> - <td>pairing_heap</td> - <td>10</td> - <td>65.160945s</td> - <td>0.154</td> - </tr> - <tr> - <td>Fibonacci</td> - <td>9</td> - <td>61.950587</td> - <td>0.145(1.06x slower)</td> - </tr> - <tr> - <td>lazy_priority_queue</td> - <td>9</td> - <td>66.592123</td> - <td>0.135(1.14x slower)</td> - </tr> - <tr> - <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> - </tr> - <tr> - <th>Library</th> - <th>Iterations</th> - <th>Seconds</th> - <th>Iterations per second</th> - </tr> - <tr> - <td>lazy_priority_queue</td> - <td>20</td> - <td>61.149944</td> - <td>0.328</td> - </tr> - <tr> - <td>pairing_heap</td> - <td>20</td> - <td>61.210225s</td> - <td>0.328</td> + <td>4009(3.17x slower)</td> </tr> <tr> <td>Fibonacci</td> - <td>18</td> - <td>62.330882</td> - <td>0.292(1.12x slower)</td> - </tr> - <tr> - <th colspan="4">truffleruby 22.2.0, like ruby 3.0.3, GraalVM CE JVM [x86_64-darwin]</th> - </tr> - <tr> - <th>Library</th> - <th>Iterations</th> - <th>Seconds</th> - <th>Iterations per second</th> - </tr> - <tr> - <td>pairing_heap</td> - <td>59</td> - <td>60.053843</td> - <td>0.991</td> + <td>2793(4.55x slower)</td> </tr> <tr> <td>lazy_priority_queue</td> - <td>34</td> - <td>60.586461</td> - <td>0.563(1.76x slower)</td> - </tr> - <tr> - <td>Fibonacci</td> - <td>31</td> - <td>60.633711</td> - <td>0.520(1.90x slower)</td> + <td>1188(10.7x slower)</td> </tr> </table> @@ -618,7 +509,7 @@ 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)). <table> <tr> - <th colspan="4">ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-darwin21]</th> + <th colspan="4">ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-darwin23]</th> </tr> <tr> <th>Library</th> @@ -628,36 +519,36 @@ </tr> <tr> <td>pairing_heap (SimplePairingHeap)</td> - <td>28</td> - <td>62.100299</td> - <td>0.451</td> + <td>41</td> + <td>60.100316</td> + <td>0.682</td> </tr> <tr> <td>pairing_heap (PairingHeap)</td> - <td>23</td> - <td>60.633153</td> - <td>0.380(1.19x slower)</td> + <td>38</td> + <td>61.003607</td> + <td>0.623(1.09x slower)</td> </tr> <tr> <td>rb_heap</td> - <td>14</td> - <td>62.019763</td> - <td>0.226(2.00x slower)</td> + <td>30</td> + <td>61.486216</td> + <td>0.488(1.40x slower)</td> </tr> <tr> <td>lazy_priority_queue</td> - <td>11</td> - <td>63.105064s</td> - <td>0.174(2.58x slower)</td> + <td>23</td> + <td>60.251764</td> + <td>0.382(1.79x slower)</td> </tr> <tr> <td>Fibonacci</td> - <td>10</td> - <td>64.407187</td> - <td>0.155(2.90x slower)</td> + <td>13</td> + <td>61.158622</td> + <td>0.213(3.21x slower)</td> </tr> <tr> - <th colspan="4">ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) +YJIT [x86_64-darwin21]</th> + <th colspan="4">ruby 3.3.0 (2023-12-25 revision 5124f9ac75) +YJIT [x86_64-darwin23]</th> </tr> <tr> <th>Library</th> @@ -667,36 +558,36 @@ </tr> <tr> <td>pairing_heap (SimplePairingHeap)</td> - <td>32</td> - <td>61.289321</td> - <td>0.522</td> + <td>65</td> + <td>60.805882</td> + <td>1.070</td> </tr> <tr> <td>pairing_heap (PairingHeap)</td> - <td>26</td> - <td>60.657625</td> - <td>0.429(1.22x slower)</td> + <td>60</td> + <td>60.790842</td> + <td>0.987(1.08x slower)</td> </tr> <tr> <td>rb_heap</td> - <td>19</td> - <td>60.710888s</td> - <td>0.313(1.67x slower)</td> + <td>54</td> + <td>60.917679</td> + <td>0.887(1.21x slower)</td> </tr> <tr> - <td>Fibonacci</td> - <td>19</td> - <td>61.471203</td> - <td>0.310(1.69x slower)</td> + <td>lazy_priority_queue</td> + <td>30</td> + <td>60.712786</td> + <td>0.495(2.16x slower)</td> </tr> <tr> - <td>lazy_priority_queue</td> - <td>12</td> - <td>60.125779</td> - <td>0.200(2.61x slower)</td> + <td>Fibonacci</td> + <td>24</td> + <td>61.900715</td> + <td>0.388(2.76x slower)</td> </tr> <tr> - <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> + <th colspan="4">jruby 9.4.5.0 (3.1.4) 2023-11-02 1abae2700f OpenJDK 64-Bit Server VM 21+35-2513 on 21+35-2513 +indy +jit [x86_64-darwin]</th> </tr> <tr> <th>Library</th> @@ -705,37 +596,37 @@ <th>Iterations per second</th> </tr> <tr> - <td>pairing_heap (SimplePairingHeap)</td> - <td>46</td> - <td>61.226924</td> - <td>0.753</td> + <td>rb_heap</td> + <td>70</td> + <td>60.077928</td> + <td>1.168</td> </tr> <tr> - <td>rb_heap</td> - <td>38</td> - <td>60.563995</td> - <td>0.628(1.20x slower)</td> + <td>pairing_heap (SimplePairingHeap)</td> + <td>66</td> + <td>60.420935</td> + <td>1.094(1.07x slower)</td> </tr> <tr> <td>pairing_heap (PairingHeap)</td> - <td>37</td> - <td>60.928350</td> - <td>0.608(1.24x slower)</td> + <td>64</td> + <td>60.114467</td> + <td>1.066(1.1x slower)</td> </tr> <tr> <td>Fibonacci</td> - <td>28</td> - <td>61.136970</td> - <td>0.461(1.63x slower)</td> + <td>54</td> + <td>60.426971</td> + <td>0.898(1.30x slower)</td> </tr> <tr> <td>lazy_priority_queue</td> - <td>22</td> - <td>62.214796</td> - <td>0.354(2.13x slower)</td> + <td>49</td> + <td>60.636963</td> + <td>0.809(1.44x slower)</td> </tr> <tr> - <th colspan="4">truffleruby 22.2.0, like ruby 3.0.3, GraalVM CE JVM [x86_64-darwin]</th> + <th colspan="4">truffleruby 23.1.2, like ruby 3.2.2, Oracle GraalVM JVM [x86_64-darwin]</th> </tr> <tr> <th>Library</th> @@ -745,33 +636,33 @@ </tr> <tr> <td>pairing_heap (SimplePairingHeap)</td> - <td>176</td> - <td>60.029817</td> - <td>3.006</td> + <td>288</td> + <td>60.102278</td> + <td>4.936</td> </tr> <tr> <td>pairing_heap (PairingHeap)</td> - <td>124</td> - <td>60.366607</td> - <td>2.078(1.45x slower)</td> + <td>232</td> + <td>60.159057</td> + <td>3.936(1.25x slower)</td> </tr> <tr> <td>rb_heap</td> - <td>95</td> - <td>60.021043</td> - <td>1.585(1.90x slower)</td> + <td>227</td> + <td>60.082482</td> + <td>3.881(1.27x slower)</td> </tr> <tr> <td>Fibonacci</td> - <td>38</td> - <td>60.020976</td> - <td>0.636(4.72x slower)</td> + <td>101</td> + <td>60.076691</td> + <td>1.721(2.87x slower)</td> </tr> <tr> <td>lazy_priority_queue</td> - <td>27</td> - <td>61.349925</td> - <td>0.445(6.75x slower)</td> + <td>66</td> + <td>60.771569</td> + <td>1.1(4.49x slower)</td> </tr> </table> @@ -779,7 +670,7 @@ #### Change priority required <table> <tr> - <th colspan="4">ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-darwin21]</th> + <th colspan="4">ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-darwin23]</th> </tr> <tr> <th>Library</th> @@ -791,14 +682,14 @@ </tr> <tr> <td>lazy_priority_queue</td> - <td>1.688x slower</td> + <td>2.1x slower</td> </tr> <tr> <td>Fibonacci</td> - <td>1.987x slower</td> + <td>3.38x slower</td> </tr> <tr> - <th colspan="4">ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) +YJIT [x86_64-darwin21]</th> + <th colspan="4">ruby 3.3.0 (2023-12-25 revision 5124f9ac75) +YJIT [x86_64-darwin23]</th> </tr> <tr> <th>Library</th> @@ -809,15 +700,15 @@ <td>1</td> </tr> <tr> - <td>Fibonacci</td> - <td>1.256x slower</td> + <td>lazy_priority_queue</td> + <td>2.55x slower</td> </tr> <tr> - <td>lazy_priority_queue</td> - <td>1.648x slower</td> + <td>Fibonacci</td> + <td>2.74x slower</td> </tr> <tr> - <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> + <th colspan="4">jruby 9.4.5.0 (3.1.4) 2023-11-02 1abae2700f OpenJDK 64-Bit Server VM 21+35-2513 on 21+35-2513 +indy +jit [x86_64-darwin]</th> </tr> <tr> <th>Library</th> @@ -829,14 +720,14 @@ </tr> <tr> <td>Fibonacci</td> - <td>1.327x slower</td> + <td>1.267x slower</td> </tr> <tr> <td>lazy_priority_queue</td> - <td>1.383x slower</td> + <td>1.396x slower</td> </tr> <tr> - <th colspan="4">truffleruby 22.2.0, like ruby 3.0.3, GraalVM CE JVM [x86_64-darwin]</th> + <th colspan="4">truffleruby 23.1.2, like ruby 3.2.2, Oracle GraalVM JVM [x86_64-darwin]</th> </tr> <tr> <th>Library</th> @@ -848,18 +739,18 @@ </tr> <tr> <td>lazy_priority_queue</td> - <td>3.878x slower</td> + <td>3.54x slower</td> </tr> <tr> <td>Fibonacci</td> - <td>9.889x slower</td> + <td>5.86x slower</td> </tr> </table> #### Change priority not required <table> <tr> - <th colspan="4">ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-darwin21]</th> + <th colspan="4">ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-darwin23]</th> </tr> <tr> <th>Library</th> @@ -871,22 +762,22 @@ </tr> <tr> <td>pairing_heap (PairingHeap)</td> - <td>1.318x slower</td> + <td>1.29x slower</td> </tr> <tr> <td>rb_heap</td> - <td>1.8x slower</td> + <td>1.53x slower</td> </tr> <tr> <td>lazy_priority_queue</td> - <td>2.519x slower</td> + <td>2.6x slower</td> </tr> <tr> <td>Fibonacci</td> - <td>2.989x slower</td> + <td>4.29x slower</td> </tr> <tr> - <th colspan="4">ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) +YJIT [x86_64-darwin21]</th> + <th colspan="4">ruby 3.3.0 (2023-12-25 revision 5124f9ac75) +YJIT [x86_64-darwin23]</th> </tr> <tr> <th>Library</th> @@ -897,23 +788,23 @@ <td>1</td> </tr> <tr> - <td>pairing_heap (PairingHeap)</td> - <td>1.348x slower</td> - </tr> - <tr> <td>rb_heap</td> - <td>1.490x slower</td> + <td>1.227x slower</td> </tr> <tr> - <td>Fibonacci</td> - <td>1.792x slower</td> + <td>pairing_heap (PairingHeap)</td> + <td>1.316x slower</td> </tr> <tr> <td>lazy_priority_queue</td> - <td>2.492x slower</td> + <td>3.094x slower</td> + </tr> + <tr> + <td>Fibonacci</td> + <td>3.79x slower</td> </tr> <tr> - <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> + <th colspan="4">jruby 9.4.5.0 (3.1.4) 2023-11-02 1abae2700f OpenJDK 64-Bit Server VM 21+35-2513 on 21+35-2513 +indy +jit [x86_64-darwin]</th> </tr> <tr> <th>Library</th> @@ -921,26 +812,26 @@ </tr> <tr> <td>pairing_heap (SimplePairingHeap)</td> - <td>1</td> + <td>1.033x slower</td> </tr> <tr> <td>rb_heap</td> - <td>1.292x slower</td> + <td>1.133x slower</td> </tr> <tr> <td>pairing_heap (PairingHeap)</td> - <td>1.359x slower</td> + <td>1.302x slower</td> </tr> <tr> <td>Fibonacci</td> - <td>1.824x slower</td> + <td>1.602x slower</td> </tr> <tr> <td>lazy_priority_queue</td> - <td>2.115x slower</td> + <td>1.777x slower</td> </tr> <tr> - <th colspan="4">truffleruby 22.2.0, like ruby 3.0.3, GraalVM CE JVM [x86_64-darwin]</th> + <th colspan="4">truffleruby 23.1.2, like ruby 3.2.2, Oracle GraalVM JVM [x86_64-darwin]</th> </tr> <tr> <th>Library</th> @@ -951,20 +842,20 @@ <td>1</td> </tr> <tr> - <td>pairing_heap (PairingHeap)</td> - <td>1.865x slower</td> + <td>rb_heap</td> + <td>1.35x slower</td> </tr> <tr> - <td>rb_heap</td> - <td>1.915x slower</td> + <td>pairing_heap (PairingHeap)</td> + <td>1.58x slower</td> </tr> <tr> <td>lazy_priority_queue</td> - <td>8.791x slower</td> + <td>5.46x slower</td> </tr> <tr> <td>Fibonacci</td> - <td>26.044x slower</td> + <td>7.54x slower</td> </tr> </table> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Rakefile new/Rakefile --- old/Rakefile 2023-04-09 15:46:33.000000000 +0200 +++ new/Rakefile 2024-02-11 16:03:25.000000000 +0100 @@ -1,5 +1,7 @@ # frozen_string_literal: true +ENV["MT_NO_PLUGINS"] = "1" # Disable autoloading of MiniTest plugins. + require "bundler/gem_tasks" require "rake/testtask" require "standard/rake" Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/pairing_heap/version.rb new/lib/pairing_heap/version.rb --- old/lib/pairing_heap/version.rb 2023-04-09 15:46:33.000000000 +0200 +++ new/lib/pairing_heap/version.rb 2024-02-11 16:03:25.000000000 +0100 @@ -1,5 +1,5 @@ # frozen_string_literal: true module PairingHeap - VERSION = "3.0.1" + VERSION = "3.1.0" end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/pairing_heap.rb new/lib/pairing_heap.rb --- old/lib/pairing_heap.rb 2023-04-09 15:46:33.000000000 +0200 +++ new/lib/pairing_heap.rb 2024-02-11 16:03:25.000000000 +0100 @@ -425,6 +425,27 @@ NodeVisitor.visit_node(@root) { |x| yield [x.elem, x.priority] } end + # Merges provided heap + # Time Complexity: O(1) + # @param other SimplePairingHeap to be merged + # @return [self] + # @raise [ArgumentError] if the provided argument is self + # @note This method modifies the argument + def merge(other) + if equal?(other) + raise ArgumentError, "Cannot merge with itself" + end + other_root = other.root + @root = if @root + other_root ? meld(@root, other_root) : @root + else + other_root + end + @size += other.size + other.clear! + self + end + private include MergePairs @@ -441,6 +462,15 @@ parent.subheaps = child parent end + + protected + + attr_reader :root + + def clear! + @root = nil + @size = 0 + end end # Priority queue where the smallest priority is the most prioritary diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2023-04-09 15:46:33.000000000 +0200 +++ new/metadata 2024-02-11 16:03:25.000000000 +0100 @@ -1,14 +1,14 @@ --- !ruby/object:Gem::Specification name: pairing_heap version: !ruby/object:Gem::Version - version: 3.0.1 + version: 3.1.0 platform: ruby authors: - Marcin Henryk Bartkowiak autorequire: bindir: exe cert_chain: [] -date: 2023-04-09 00:00:00.000000000 Z +date: 2024-02-11 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: minitest @@ -16,14 +16,14 @@ requirements: - - "~>" - !ruby/object:Gem::Version - version: '5.0' + version: '5.21' type: :development prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version - version: '5.0' + version: '5.21' - !ruby/object:Gem::Dependency name: rake requirement: !ruby/object:Gem::Requirement @@ -58,14 +58,14 @@ requirements: - - "~>" - !ruby/object:Gem::Version - version: '1.20' + version: '1.31' type: :development prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version - version: '1.20' + version: '1.31' description: Performant priority queue in pure ruby with support for changing priority using pairing heap data structure email: @@ -94,6 +94,7 @@ homepage_uri: https://github.com/mhib/pairing_heap source_code_uri: https://github.com/mhib/pairing_heap documentation_uri: https://rubydoc.info/gems/pairing_heap + rubygems_mfa_required: 'true' post_install_message: rdoc_options: [] require_paths: @@ -109,7 +110,7 @@ - !ruby/object:Gem::Version version: '0' requirements: [] -rubygems_version: 3.4.1 +rubygems_version: 3.5.3 signing_key: specification_version: 4 summary: Performant priority queue in pure ruby with support for changing priority diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pairing_heap.gemspec new/pairing_heap.gemspec --- old/pairing_heap.gemspec 2023-04-09 15:46:33.000000000 +0200 +++ new/pairing_heap.gemspec 2024-02-11 16:03:25.000000000 +0100 @@ -17,9 +17,8 @@ spec.metadata["homepage_uri"] = spec.homepage spec.metadata["source_code_uri"] = spec.homepage spec.metadata["documentation_uri"] = "https://rubydoc.info/gems/pairing_heap" + spec.metadata["rubygems_mfa_required"] = "true" - # Specify which files should be added to the gem when it is released. - # The `git ls-files -z` loads the files in the RubyGem that have been added into git. spec.files = Dir.chdir(File.expand_path(__dir__)) do `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) } end @@ -27,14 +26,8 @@ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) } spec.require_paths = ["lib"] - # Uncomment to register a new dependency of your gem - # spec.add_dependency "example-gem", "~> 1.0" - - spec.add_development_dependency "minitest", "~> 5.0" + spec.add_development_dependency "minitest", "~> 5.21" spec.add_development_dependency "rake", "~> 13.0" spec.add_development_dependency "simplecov", "~> 0.22.0" - spec.add_development_dependency "standard", "~> 1.20" - - # For more information and examples about making a new gem, checkout our - # guide at: https://bundler.io/guides/creating_gem.html + spec.add_development_dependency "standard", "~> 1.31" end
137
Age (days ago)
137
Last active (days ago)
0 comments
1 participants
participants (1)
-
Source-Sync