data-structure-typed 1.43.0 → 1.43.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -1
- package/README.md +21 -12
- package/benchmark/report.html +21 -12
- package/benchmark/report.json +148 -103
- package/package.json +3 -2
- package/test/config.ts +2 -1
- package/test/integration/index.html +30 -11
- package/test/performance/data-structures/binary-tree/rb-tree.test.ts +21 -8
- package/test/performance/data-structures/hash/hash-map.test.ts +51 -0
- package/test/performance/data-structures/linked-list/doubly-linked-list.test.ts +12 -1
- package/test/performance/data-structures/priority-queue/priority-queue.test.ts +37 -0
- package/test/performance/data-structures/queue/deque.test.ts +11 -1
- package/test/performance/data-structures/queue/queue.test.ts +12 -1
- package/test/performance/data-structures/stack/stack.test.ts +50 -0
package/CHANGELOG.md
CHANGED
|
@@ -8,7 +8,7 @@ All notable changes to this project will be documented in this file.
|
|
|
8
8
|
- [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
|
|
9
9
|
- [`auto-changelog`](https://github.com/CookPete/auto-changelog)
|
|
10
10
|
|
|
11
|
-
## [v1.43.
|
|
11
|
+
## [v1.43.1](https://github.com/zrwusa/data-structure-typed/compare/v1.35.0...main) (upcoming)
|
|
12
12
|
|
|
13
13
|
### Changes
|
|
14
14
|
|
package/README.md
CHANGED
|
@@ -728,40 +728,49 @@ optimal approach to data structure design.
|
|
|
728
728
|
[//]: # (No deletion!!! Start of Replace Section)
|
|
729
729
|
<div class="json-to-html-collapse clearfix 0">
|
|
730
730
|
<div class='collapsible level0' ><span class='json-to-html-label'>avl-tree</span></div>
|
|
731
|
-
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>10,000 add randomly</td><td>
|
|
731
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>10,000 add randomly</td><td>35.38</td><td>28.26</td><td>0.00</td></tr><tr><td>10,000 add & delete randomly</td><td>80.65</td><td>12.40</td><td>0.01</td></tr><tr><td>10,000 addMany</td><td>46.45</td><td>21.53</td><td>9.97e-4</td></tr><tr><td>10,000 get</td><td>31.59</td><td>31.66</td><td>0.00</td></tr></table></div>
|
|
732
732
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
733
733
|
<div class='collapsible level0' ><span class='json-to-html-label'>binary-tree</span></div>
|
|
734
|
-
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>1,000 add randomly</td><td>
|
|
734
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>1,000 add randomly</td><td>13.01</td><td>76.84</td><td>7.71e-4</td></tr><tr><td>1,000 add & delete randomly</td><td>16.82</td><td>59.46</td><td>0.00</td></tr><tr><td>1,000 addMany</td><td>10.46</td><td>95.62</td><td>2.13e-4</td></tr><tr><td>1,000 get</td><td>18.44</td><td>54.22</td><td>2.49e-4</td></tr><tr><td>1,000 dfs</td><td>163.31</td><td>6.12</td><td>0.01</td></tr><tr><td>1,000 bfs</td><td>58.07</td><td>17.22</td><td>0.00</td></tr><tr><td>1,000 morris</td><td>273.11</td><td>3.66</td><td>0.00</td></tr></table></div>
|
|
735
735
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
736
736
|
<div class='collapsible level0' ><span class='json-to-html-label'>bst</span></div>
|
|
737
|
-
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>10,000 add randomly</td><td>
|
|
737
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>10,000 add randomly</td><td>33.44</td><td>29.91</td><td>5.09e-4</td></tr><tr><td>10,000 add & delete randomly</td><td>76.03</td><td>13.15</td><td>0.00</td></tr><tr><td>10,000 addMany</td><td>32.26</td><td>31.00</td><td>0.00</td></tr><tr><td>10,000 get</td><td>32.75</td><td>30.53</td><td>0.01</td></tr></table></div>
|
|
738
738
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
739
739
|
<div class='collapsible level0' ><span class='json-to-html-label'>rb-tree</span></div>
|
|
740
|
-
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>100,000 add
|
|
740
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>100,000 add</td><td>99.27</td><td>10.07</td><td>0.01</td></tr><tr><td>100,000 add & delete randomly</td><td>233.22</td><td>4.29</td><td>0.01</td></tr><tr><td>100,000 getNode</td><td>148.41</td><td>6.74</td><td>0.00</td></tr></table></div>
|
|
741
741
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
742
742
|
<div class='collapsible level0' ><span class='json-to-html-label'>directed-graph</span></div>
|
|
743
|
-
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>1,000 addVertex</td><td>0.
|
|
743
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>1,000 addVertex</td><td>0.11</td><td>9381.52</td><td>3.21e-6</td></tr><tr><td>1,000 addEdge</td><td>6.36</td><td>157.14</td><td>7.19e-4</td></tr><tr><td>1,000 getVertex</td><td>0.05</td><td>2.09e+4</td><td>2.72e-6</td></tr><tr><td>1,000 getEdge</td><td>24.66</td><td>40.55</td><td>0.00</td></tr><tr><td>tarjan</td><td>219.65</td><td>4.55</td><td>0.01</td></tr><tr><td>tarjan all</td><td>239.68</td><td>4.17</td><td>0.04</td></tr><tr><td>topologicalSort</td><td>216.14</td><td>4.63</td><td>0.07</td></tr></table></div>
|
|
744
|
+
</div><div class="json-to-html-collapse clearfix 0">
|
|
745
|
+
<div class='collapsible level0' ><span class='json-to-html-label'>hash-map</span></div>
|
|
746
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>10,000 set</td><td>19.50</td><td>51.27</td><td>0.01</td></tr><tr><td>10,000 set & get</td><td>38.20</td><td>26.18</td><td>0.01</td></tr></table></div>
|
|
744
747
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
745
748
|
<div class='collapsible level0' ><span class='json-to-html-label'>heap</span></div>
|
|
746
|
-
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>10,000 add & pop</td><td>4.
|
|
749
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>10,000 add & pop</td><td>4.86</td><td>205.69</td><td>7.04e-4</td></tr><tr><td>10,000 fib add & pop</td><td>386.50</td><td>2.59</td><td>0.03</td></tr></table></div>
|
|
747
750
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
748
751
|
<div class='collapsible level0' ><span class='json-to-html-label'>doubly-linked-list</span></div>
|
|
749
|
-
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>1,000,000 unshift</td><td>
|
|
752
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>1,000,000 unshift</td><td>243.46</td><td>4.11</td><td>0.05</td></tr><tr><td>1,000,000 unshift & shift</td><td>178.49</td><td>5.60</td><td>0.02</td></tr><tr><td>1,000,000 insertBefore</td><td>326.38</td><td>3.06</td><td>0.07</td></tr></table></div>
|
|
750
753
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
751
754
|
<div class='collapsible level0' ><span class='json-to-html-label'>singly-linked-list</span></div>
|
|
752
|
-
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>10,000 push & pop</td><td>
|
|
755
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>10,000 push & pop</td><td>232.85</td><td>4.29</td><td>0.01</td></tr><tr><td>10,000 insertBefore</td><td>255.90</td><td>3.91</td><td>0.01</td></tr></table></div>
|
|
753
756
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
754
757
|
<div class='collapsible level0' ><span class='json-to-html-label'>max-priority-queue</span></div>
|
|
755
|
-
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>10,000 refill & poll</td><td>11.
|
|
758
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>10,000 refill & poll</td><td>11.88</td><td>84.15</td><td>0.00</td></tr></table></div>
|
|
759
|
+
</div><div class="json-to-html-collapse clearfix 0">
|
|
760
|
+
<div class='collapsible level0' ><span class='json-to-html-label'>priority-queue</span></div>
|
|
761
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>10,000 add & pop</td><td>12.60</td><td>79.35</td><td>1.40e-4</td></tr></table></div>
|
|
756
762
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
757
763
|
<div class='collapsible level0' ><span class='json-to-html-label'>deque</span></div>
|
|
758
|
-
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>1,000,000 push</td><td>
|
|
764
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>1,000,000 push</td><td>226.32</td><td>4.42</td><td>0.03</td></tr><tr><td>1,000,000 shift</td><td>26.09</td><td>38.33</td><td>0.00</td></tr></table></div>
|
|
759
765
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
760
766
|
<div class='collapsible level0' ><span class='json-to-html-label'>queue</span></div>
|
|
761
|
-
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>1,000,000 push</td><td>45.
|
|
767
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>1,000,000 push</td><td>45.45</td><td>22.00</td><td>0.01</td></tr><tr><td>1,000,000 push & shift</td><td>82.87</td><td>12.07</td><td>0.00</td></tr></table></div>
|
|
768
|
+
</div><div class="json-to-html-collapse clearfix 0">
|
|
769
|
+
<div class='collapsible level0' ><span class='json-to-html-label'>stack</span></div>
|
|
770
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>1,000,000 push</td><td>43.95</td><td>22.75</td><td>0.01</td></tr><tr><td>1,000,000 push & pop</td><td>50.91</td><td>19.64</td><td>0.00</td></tr></table></div>
|
|
762
771
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
763
772
|
<div class='collapsible level0' ><span class='json-to-html-label'>trie</span></div>
|
|
764
|
-
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>100,000 push</td><td>
|
|
773
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>100,000 push</td><td>50.20</td><td>19.92</td><td>0.00</td></tr><tr><td>100,000 getWords</td><td>110.08</td><td>9.08</td><td>0.01</td></tr></table></div>
|
|
765
774
|
</div>
|
|
766
775
|
|
|
767
776
|
[//]: # (No deletion!!! End of Replace Section)
|
package/benchmark/report.html
CHANGED
|
@@ -43,40 +43,49 @@
|
|
|
43
43
|
<body>
|
|
44
44
|
<div id="json-to-html"><div class="json-to-html-collapse clearfix 0">
|
|
45
45
|
<div class='collapsible level0' ><span class='json-to-html-label'>avl-tree</span></div>
|
|
46
|
-
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>10,000 add randomly</td><td>
|
|
46
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>10,000 add randomly</td><td>35.38</td><td>28.26</td><td>0.00</td></tr><tr><td>10,000 add & delete randomly</td><td>80.65</td><td>12.40</td><td>0.01</td></tr><tr><td>10,000 addMany</td><td>46.45</td><td>21.53</td><td>9.97e-4</td></tr><tr><td>10,000 get</td><td>31.59</td><td>31.66</td><td>0.00</td></tr></table></div>
|
|
47
47
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
48
48
|
<div class='collapsible level0' ><span class='json-to-html-label'>binary-tree</span></div>
|
|
49
|
-
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>1,000 add randomly</td><td>
|
|
49
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>1,000 add randomly</td><td>13.01</td><td>76.84</td><td>7.71e-4</td></tr><tr><td>1,000 add & delete randomly</td><td>16.82</td><td>59.46</td><td>0.00</td></tr><tr><td>1,000 addMany</td><td>10.46</td><td>95.62</td><td>2.13e-4</td></tr><tr><td>1,000 get</td><td>18.44</td><td>54.22</td><td>2.49e-4</td></tr><tr><td>1,000 dfs</td><td>163.31</td><td>6.12</td><td>0.01</td></tr><tr><td>1,000 bfs</td><td>58.07</td><td>17.22</td><td>0.00</td></tr><tr><td>1,000 morris</td><td>273.11</td><td>3.66</td><td>0.00</td></tr></table></div>
|
|
50
50
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
51
51
|
<div class='collapsible level0' ><span class='json-to-html-label'>bst</span></div>
|
|
52
|
-
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>10,000 add randomly</td><td>
|
|
52
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>10,000 add randomly</td><td>33.44</td><td>29.91</td><td>5.09e-4</td></tr><tr><td>10,000 add & delete randomly</td><td>76.03</td><td>13.15</td><td>0.00</td></tr><tr><td>10,000 addMany</td><td>32.26</td><td>31.00</td><td>0.00</td></tr><tr><td>10,000 get</td><td>32.75</td><td>30.53</td><td>0.01</td></tr></table></div>
|
|
53
53
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
54
54
|
<div class='collapsible level0' ><span class='json-to-html-label'>rb-tree</span></div>
|
|
55
|
-
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>100,000 add
|
|
55
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>100,000 add</td><td>99.27</td><td>10.07</td><td>0.01</td></tr><tr><td>100,000 add & delete randomly</td><td>233.22</td><td>4.29</td><td>0.01</td></tr><tr><td>100,000 getNode</td><td>148.41</td><td>6.74</td><td>0.00</td></tr></table></div>
|
|
56
56
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
57
57
|
<div class='collapsible level0' ><span class='json-to-html-label'>directed-graph</span></div>
|
|
58
|
-
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>1,000 addVertex</td><td>0.
|
|
58
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>1,000 addVertex</td><td>0.11</td><td>9381.52</td><td>3.21e-6</td></tr><tr><td>1,000 addEdge</td><td>6.36</td><td>157.14</td><td>7.19e-4</td></tr><tr><td>1,000 getVertex</td><td>0.05</td><td>2.09e+4</td><td>2.72e-6</td></tr><tr><td>1,000 getEdge</td><td>24.66</td><td>40.55</td><td>0.00</td></tr><tr><td>tarjan</td><td>219.65</td><td>4.55</td><td>0.01</td></tr><tr><td>tarjan all</td><td>239.68</td><td>4.17</td><td>0.04</td></tr><tr><td>topologicalSort</td><td>216.14</td><td>4.63</td><td>0.07</td></tr></table></div>
|
|
59
|
+
</div><div class="json-to-html-collapse clearfix 0">
|
|
60
|
+
<div class='collapsible level0' ><span class='json-to-html-label'>hash-map</span></div>
|
|
61
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>10,000 set</td><td>19.50</td><td>51.27</td><td>0.01</td></tr><tr><td>10,000 set & get</td><td>38.20</td><td>26.18</td><td>0.01</td></tr></table></div>
|
|
59
62
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
60
63
|
<div class='collapsible level0' ><span class='json-to-html-label'>heap</span></div>
|
|
61
|
-
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>10,000 add & pop</td><td>4.
|
|
64
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>10,000 add & pop</td><td>4.86</td><td>205.69</td><td>7.04e-4</td></tr><tr><td>10,000 fib add & pop</td><td>386.50</td><td>2.59</td><td>0.03</td></tr></table></div>
|
|
62
65
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
63
66
|
<div class='collapsible level0' ><span class='json-to-html-label'>doubly-linked-list</span></div>
|
|
64
|
-
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>1,000,000 unshift</td><td>
|
|
67
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>1,000,000 unshift</td><td>243.46</td><td>4.11</td><td>0.05</td></tr><tr><td>1,000,000 unshift & shift</td><td>178.49</td><td>5.60</td><td>0.02</td></tr><tr><td>1,000,000 insertBefore</td><td>326.38</td><td>3.06</td><td>0.07</td></tr></table></div>
|
|
65
68
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
66
69
|
<div class='collapsible level0' ><span class='json-to-html-label'>singly-linked-list</span></div>
|
|
67
|
-
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>10,000 push & pop</td><td>
|
|
70
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>10,000 push & pop</td><td>232.85</td><td>4.29</td><td>0.01</td></tr><tr><td>10,000 insertBefore</td><td>255.90</td><td>3.91</td><td>0.01</td></tr></table></div>
|
|
68
71
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
69
72
|
<div class='collapsible level0' ><span class='json-to-html-label'>max-priority-queue</span></div>
|
|
70
|
-
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>10,000 refill & poll</td><td>11.
|
|
73
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>10,000 refill & poll</td><td>11.88</td><td>84.15</td><td>0.00</td></tr></table></div>
|
|
74
|
+
</div><div class="json-to-html-collapse clearfix 0">
|
|
75
|
+
<div class='collapsible level0' ><span class='json-to-html-label'>priority-queue</span></div>
|
|
76
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>10,000 add & pop</td><td>12.60</td><td>79.35</td><td>1.40e-4</td></tr></table></div>
|
|
71
77
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
72
78
|
<div class='collapsible level0' ><span class='json-to-html-label'>deque</span></div>
|
|
73
|
-
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>1,000,000 push</td><td>
|
|
79
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>1,000,000 push</td><td>226.32</td><td>4.42</td><td>0.03</td></tr><tr><td>1,000,000 shift</td><td>26.09</td><td>38.33</td><td>0.00</td></tr></table></div>
|
|
74
80
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
75
81
|
<div class='collapsible level0' ><span class='json-to-html-label'>queue</span></div>
|
|
76
|
-
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>1,000,000 push</td><td>45.
|
|
82
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>1,000,000 push</td><td>45.45</td><td>22.00</td><td>0.01</td></tr><tr><td>1,000,000 push & shift</td><td>82.87</td><td>12.07</td><td>0.00</td></tr></table></div>
|
|
83
|
+
</div><div class="json-to-html-collapse clearfix 0">
|
|
84
|
+
<div class='collapsible level0' ><span class='json-to-html-label'>stack</span></div>
|
|
85
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>1,000,000 push</td><td>43.95</td><td>22.75</td><td>0.01</td></tr><tr><td>1,000,000 push & pop</td><td>50.91</td><td>19.64</td><td>0.00</td></tr></table></div>
|
|
77
86
|
</div><div class="json-to-html-collapse clearfix 0">
|
|
78
87
|
<div class='collapsible level0' ><span class='json-to-html-label'>trie</span></div>
|
|
79
|
-
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>100,000 push</td><td>
|
|
88
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>100,000 push</td><td>50.20</td><td>19.92</td><td>0.00</td></tr><tr><td>100,000 getWords</td><td>110.08</td><td>9.08</td><td>0.01</td></tr></table></div>
|
|
80
89
|
</div>
|
|
81
90
|
|
|
82
91
|
</div>
|
package/benchmark/report.json
CHANGED
|
@@ -3,26 +3,26 @@
|
|
|
3
3
|
"benchmarks": [
|
|
4
4
|
{
|
|
5
5
|
"test name": "10,000 add randomly",
|
|
6
|
-
"time taken (ms)": "
|
|
7
|
-
"executions per sec": "
|
|
6
|
+
"time taken (ms)": "35.38",
|
|
7
|
+
"executions per sec": "28.26",
|
|
8
8
|
"sample deviation": "0.00"
|
|
9
9
|
},
|
|
10
10
|
{
|
|
11
11
|
"test name": "10,000 add & delete randomly",
|
|
12
|
-
"time taken (ms)": "
|
|
13
|
-
"executions per sec": "
|
|
12
|
+
"time taken (ms)": "80.65",
|
|
13
|
+
"executions per sec": "12.40",
|
|
14
14
|
"sample deviation": "0.01"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
"test name": "10,000 addMany",
|
|
18
|
-
"time taken (ms)": "
|
|
19
|
-
"executions per sec": "
|
|
20
|
-
"sample deviation": "
|
|
18
|
+
"time taken (ms)": "46.45",
|
|
19
|
+
"executions per sec": "21.53",
|
|
20
|
+
"sample deviation": "9.97e-4"
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
23
|
"test name": "10,000 get",
|
|
24
|
-
"time taken (ms)": "
|
|
25
|
-
"executions per sec": "
|
|
24
|
+
"time taken (ms)": "31.59",
|
|
25
|
+
"executions per sec": "31.66",
|
|
26
26
|
"sample deviation": "0.00"
|
|
27
27
|
}
|
|
28
28
|
],
|
|
@@ -32,44 +32,44 @@
|
|
|
32
32
|
"benchmarks": [
|
|
33
33
|
{
|
|
34
34
|
"test name": "1,000 add randomly",
|
|
35
|
-
"time taken (ms)": "
|
|
36
|
-
"executions per sec": "
|
|
37
|
-
"sample deviation": "
|
|
35
|
+
"time taken (ms)": "13.01",
|
|
36
|
+
"executions per sec": "76.84",
|
|
37
|
+
"sample deviation": "7.71e-4"
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
40
|
"test name": "1,000 add & delete randomly",
|
|
41
|
-
"time taken (ms)": "16.
|
|
42
|
-
"executions per sec": "
|
|
43
|
-
"sample deviation": "
|
|
41
|
+
"time taken (ms)": "16.82",
|
|
42
|
+
"executions per sec": "59.46",
|
|
43
|
+
"sample deviation": "0.00"
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
46
|
"test name": "1,000 addMany",
|
|
47
|
-
"time taken (ms)": "10.
|
|
48
|
-
"executions per sec": "95.
|
|
49
|
-
"sample deviation": "
|
|
47
|
+
"time taken (ms)": "10.46",
|
|
48
|
+
"executions per sec": "95.62",
|
|
49
|
+
"sample deviation": "2.13e-4"
|
|
50
50
|
},
|
|
51
51
|
{
|
|
52
52
|
"test name": "1,000 get",
|
|
53
|
-
"time taken (ms)": "18.
|
|
54
|
-
"executions per sec": "54.
|
|
55
|
-
"sample deviation": "
|
|
53
|
+
"time taken (ms)": "18.44",
|
|
54
|
+
"executions per sec": "54.22",
|
|
55
|
+
"sample deviation": "2.49e-4"
|
|
56
56
|
},
|
|
57
57
|
{
|
|
58
58
|
"test name": "1,000 dfs",
|
|
59
|
-
"time taken (ms)": "
|
|
60
|
-
"executions per sec": "6.
|
|
61
|
-
"sample deviation": "0.
|
|
59
|
+
"time taken (ms)": "163.31",
|
|
60
|
+
"executions per sec": "6.12",
|
|
61
|
+
"sample deviation": "0.01"
|
|
62
62
|
},
|
|
63
63
|
{
|
|
64
64
|
"test name": "1,000 bfs",
|
|
65
|
-
"time taken (ms)": "
|
|
66
|
-
"executions per sec": "17.
|
|
67
|
-
"sample deviation": "
|
|
65
|
+
"time taken (ms)": "58.07",
|
|
66
|
+
"executions per sec": "17.22",
|
|
67
|
+
"sample deviation": "0.00"
|
|
68
68
|
},
|
|
69
69
|
{
|
|
70
70
|
"test name": "1,000 morris",
|
|
71
|
-
"time taken (ms)": "
|
|
72
|
-
"executions per sec": "3.
|
|
71
|
+
"time taken (ms)": "273.11",
|
|
72
|
+
"executions per sec": "3.66",
|
|
73
73
|
"sample deviation": "0.00"
|
|
74
74
|
}
|
|
75
75
|
],
|
|
@@ -79,27 +79,27 @@
|
|
|
79
79
|
"benchmarks": [
|
|
80
80
|
{
|
|
81
81
|
"test name": "10,000 add randomly",
|
|
82
|
-
"time taken (ms)": "
|
|
83
|
-
"executions per sec": "
|
|
84
|
-
"sample deviation": "
|
|
82
|
+
"time taken (ms)": "33.44",
|
|
83
|
+
"executions per sec": "29.91",
|
|
84
|
+
"sample deviation": "5.09e-4"
|
|
85
85
|
},
|
|
86
86
|
{
|
|
87
87
|
"test name": "10,000 add & delete randomly",
|
|
88
|
-
"time taken (ms)": "
|
|
89
|
-
"executions per sec": "
|
|
88
|
+
"time taken (ms)": "76.03",
|
|
89
|
+
"executions per sec": "13.15",
|
|
90
90
|
"sample deviation": "0.00"
|
|
91
91
|
},
|
|
92
92
|
{
|
|
93
93
|
"test name": "10,000 addMany",
|
|
94
|
-
"time taken (ms)": "
|
|
95
|
-
"executions per sec": "
|
|
96
|
-
"sample deviation": "
|
|
94
|
+
"time taken (ms)": "32.26",
|
|
95
|
+
"executions per sec": "31.00",
|
|
96
|
+
"sample deviation": "0.00"
|
|
97
97
|
},
|
|
98
98
|
{
|
|
99
99
|
"test name": "10,000 get",
|
|
100
|
-
"time taken (ms)": "
|
|
101
|
-
"executions per sec": "
|
|
102
|
-
"sample deviation": "
|
|
100
|
+
"time taken (ms)": "32.75",
|
|
101
|
+
"executions per sec": "30.53",
|
|
102
|
+
"sample deviation": "0.01"
|
|
103
103
|
}
|
|
104
104
|
],
|
|
105
105
|
"testName": "bst"
|
|
@@ -107,22 +107,22 @@
|
|
|
107
107
|
"rb-tree": {
|
|
108
108
|
"benchmarks": [
|
|
109
109
|
{
|
|
110
|
-
"test name": "100,000 add
|
|
111
|
-
"time taken (ms)": "
|
|
112
|
-
"executions per sec": "
|
|
110
|
+
"test name": "100,000 add",
|
|
111
|
+
"time taken (ms)": "99.27",
|
|
112
|
+
"executions per sec": "10.07",
|
|
113
113
|
"sample deviation": "0.01"
|
|
114
114
|
},
|
|
115
115
|
{
|
|
116
116
|
"test name": "100,000 add & delete randomly",
|
|
117
|
-
"time taken (ms)": "
|
|
118
|
-
"executions per sec": "4.
|
|
117
|
+
"time taken (ms)": "233.22",
|
|
118
|
+
"executions per sec": "4.29",
|
|
119
119
|
"sample deviation": "0.01"
|
|
120
120
|
},
|
|
121
121
|
{
|
|
122
122
|
"test name": "100,000 getNode",
|
|
123
|
-
"time taken (ms)": "
|
|
124
|
-
"executions per sec": "
|
|
125
|
-
"sample deviation": "
|
|
123
|
+
"time taken (ms)": "148.41",
|
|
124
|
+
"executions per sec": "6.74",
|
|
125
|
+
"sample deviation": "0.00"
|
|
126
126
|
}
|
|
127
127
|
],
|
|
128
128
|
"testName": "rb-tree"
|
|
@@ -131,62 +131,79 @@
|
|
|
131
131
|
"benchmarks": [
|
|
132
132
|
{
|
|
133
133
|
"test name": "1,000 addVertex",
|
|
134
|
-
"time taken (ms)": "0.
|
|
135
|
-
"executions per sec": "
|
|
136
|
-
"sample deviation": "
|
|
134
|
+
"time taken (ms)": "0.11",
|
|
135
|
+
"executions per sec": "9381.52",
|
|
136
|
+
"sample deviation": "3.21e-6"
|
|
137
137
|
},
|
|
138
138
|
{
|
|
139
139
|
"test name": "1,000 addEdge",
|
|
140
|
-
"time taken (ms)": "6.
|
|
141
|
-
"executions per sec": "
|
|
142
|
-
"sample deviation": "
|
|
140
|
+
"time taken (ms)": "6.36",
|
|
141
|
+
"executions per sec": "157.14",
|
|
142
|
+
"sample deviation": "7.19e-4"
|
|
143
143
|
},
|
|
144
144
|
{
|
|
145
145
|
"test name": "1,000 getVertex",
|
|
146
146
|
"time taken (ms)": "0.05",
|
|
147
|
-
"executions per sec": "2.
|
|
148
|
-
"sample deviation": "
|
|
147
|
+
"executions per sec": "2.09e+4",
|
|
148
|
+
"sample deviation": "2.72e-6"
|
|
149
149
|
},
|
|
150
150
|
{
|
|
151
151
|
"test name": "1,000 getEdge",
|
|
152
|
-
"time taken (ms)": "
|
|
153
|
-
"executions per sec": "
|
|
152
|
+
"time taken (ms)": "24.66",
|
|
153
|
+
"executions per sec": "40.55",
|
|
154
154
|
"sample deviation": "0.00"
|
|
155
155
|
},
|
|
156
156
|
{
|
|
157
157
|
"test name": "tarjan",
|
|
158
|
-
"time taken (ms)": "
|
|
159
|
-
"executions per sec": "4.
|
|
158
|
+
"time taken (ms)": "219.65",
|
|
159
|
+
"executions per sec": "4.55",
|
|
160
160
|
"sample deviation": "0.01"
|
|
161
161
|
},
|
|
162
162
|
{
|
|
163
163
|
"test name": "tarjan all",
|
|
164
|
-
"time taken (ms)": "
|
|
165
|
-
"executions per sec": "4.
|
|
166
|
-
"sample deviation": "0.
|
|
164
|
+
"time taken (ms)": "239.68",
|
|
165
|
+
"executions per sec": "4.17",
|
|
166
|
+
"sample deviation": "0.04"
|
|
167
167
|
},
|
|
168
168
|
{
|
|
169
169
|
"test name": "topologicalSort",
|
|
170
|
-
"time taken (ms)": "
|
|
171
|
-
"executions per sec": "
|
|
172
|
-
"sample deviation": "0.
|
|
170
|
+
"time taken (ms)": "216.14",
|
|
171
|
+
"executions per sec": "4.63",
|
|
172
|
+
"sample deviation": "0.07"
|
|
173
173
|
}
|
|
174
174
|
],
|
|
175
175
|
"testName": "directed-graph"
|
|
176
176
|
},
|
|
177
|
+
"hash-map": {
|
|
178
|
+
"benchmarks": [
|
|
179
|
+
{
|
|
180
|
+
"test name": "10,000 set",
|
|
181
|
+
"time taken (ms)": "19.50",
|
|
182
|
+
"executions per sec": "51.27",
|
|
183
|
+
"sample deviation": "0.01"
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"test name": "10,000 set & get",
|
|
187
|
+
"time taken (ms)": "38.20",
|
|
188
|
+
"executions per sec": "26.18",
|
|
189
|
+
"sample deviation": "0.01"
|
|
190
|
+
}
|
|
191
|
+
],
|
|
192
|
+
"testName": "hash-map"
|
|
193
|
+
},
|
|
177
194
|
"heap": {
|
|
178
195
|
"benchmarks": [
|
|
179
196
|
{
|
|
180
197
|
"test name": "10,000 add & pop",
|
|
181
|
-
"time taken (ms)": "4.
|
|
182
|
-
"executions per sec": "
|
|
183
|
-
"sample deviation": "
|
|
198
|
+
"time taken (ms)": "4.86",
|
|
199
|
+
"executions per sec": "205.69",
|
|
200
|
+
"sample deviation": "7.04e-4"
|
|
184
201
|
},
|
|
185
202
|
{
|
|
186
203
|
"test name": "10,000 fib add & pop",
|
|
187
|
-
"time taken (ms)": "
|
|
188
|
-
"executions per sec": "2.
|
|
189
|
-
"sample deviation": "0.
|
|
204
|
+
"time taken (ms)": "386.50",
|
|
205
|
+
"executions per sec": "2.59",
|
|
206
|
+
"sample deviation": "0.03"
|
|
190
207
|
}
|
|
191
208
|
],
|
|
192
209
|
"testName": "heap"
|
|
@@ -195,21 +212,21 @@
|
|
|
195
212
|
"benchmarks": [
|
|
196
213
|
{
|
|
197
214
|
"test name": "1,000,000 unshift",
|
|
198
|
-
"time taken (ms)": "
|
|
199
|
-
"executions per sec": "4.
|
|
200
|
-
"sample deviation": "0.
|
|
215
|
+
"time taken (ms)": "243.46",
|
|
216
|
+
"executions per sec": "4.11",
|
|
217
|
+
"sample deviation": "0.05"
|
|
201
218
|
},
|
|
202
219
|
{
|
|
203
220
|
"test name": "1,000,000 unshift & shift",
|
|
204
|
-
"time taken (ms)": "
|
|
205
|
-
"executions per sec": "
|
|
221
|
+
"time taken (ms)": "178.49",
|
|
222
|
+
"executions per sec": "5.60",
|
|
206
223
|
"sample deviation": "0.02"
|
|
207
224
|
},
|
|
208
225
|
{
|
|
209
226
|
"test name": "1,000,000 insertBefore",
|
|
210
|
-
"time taken (ms)": "
|
|
211
|
-
"executions per sec": "
|
|
212
|
-
"sample deviation": "0.
|
|
227
|
+
"time taken (ms)": "326.38",
|
|
228
|
+
"executions per sec": "3.06",
|
|
229
|
+
"sample deviation": "0.07"
|
|
213
230
|
}
|
|
214
231
|
],
|
|
215
232
|
"testName": "doubly-linked-list"
|
|
@@ -218,15 +235,15 @@
|
|
|
218
235
|
"benchmarks": [
|
|
219
236
|
{
|
|
220
237
|
"test name": "10,000 push & pop",
|
|
221
|
-
"time taken (ms)": "
|
|
222
|
-
"executions per sec": "4.
|
|
223
|
-
"sample deviation": "0.
|
|
238
|
+
"time taken (ms)": "232.85",
|
|
239
|
+
"executions per sec": "4.29",
|
|
240
|
+
"sample deviation": "0.01"
|
|
224
241
|
},
|
|
225
242
|
{
|
|
226
243
|
"test name": "10,000 insertBefore",
|
|
227
|
-
"time taken (ms)": "
|
|
228
|
-
"executions per sec": "
|
|
229
|
-
"sample deviation": "0.
|
|
244
|
+
"time taken (ms)": "255.90",
|
|
245
|
+
"executions per sec": "3.91",
|
|
246
|
+
"sample deviation": "0.01"
|
|
230
247
|
}
|
|
231
248
|
],
|
|
232
249
|
"testName": "singly-linked-list"
|
|
@@ -235,25 +252,36 @@
|
|
|
235
252
|
"benchmarks": [
|
|
236
253
|
{
|
|
237
254
|
"test name": "10,000 refill & poll",
|
|
238
|
-
"time taken (ms)": "11.
|
|
239
|
-
"executions per sec": "
|
|
240
|
-
"sample deviation": "
|
|
255
|
+
"time taken (ms)": "11.88",
|
|
256
|
+
"executions per sec": "84.15",
|
|
257
|
+
"sample deviation": "0.00"
|
|
241
258
|
}
|
|
242
259
|
],
|
|
243
260
|
"testName": "max-priority-queue"
|
|
244
261
|
},
|
|
262
|
+
"priority-queue": {
|
|
263
|
+
"benchmarks": [
|
|
264
|
+
{
|
|
265
|
+
"test name": "10,000 add & pop",
|
|
266
|
+
"time taken (ms)": "12.60",
|
|
267
|
+
"executions per sec": "79.35",
|
|
268
|
+
"sample deviation": "1.40e-4"
|
|
269
|
+
}
|
|
270
|
+
],
|
|
271
|
+
"testName": "priority-queue"
|
|
272
|
+
},
|
|
245
273
|
"deque": {
|
|
246
274
|
"benchmarks": [
|
|
247
275
|
{
|
|
248
276
|
"test name": "1,000,000 push",
|
|
249
|
-
"time taken (ms)": "
|
|
250
|
-
"executions per sec": "4.
|
|
251
|
-
"sample deviation": "0.
|
|
277
|
+
"time taken (ms)": "226.32",
|
|
278
|
+
"executions per sec": "4.42",
|
|
279
|
+
"sample deviation": "0.03"
|
|
252
280
|
},
|
|
253
281
|
{
|
|
254
282
|
"test name": "1,000,000 shift",
|
|
255
|
-
"time taken (ms)": "26.
|
|
256
|
-
"executions per sec": "
|
|
283
|
+
"time taken (ms)": "26.09",
|
|
284
|
+
"executions per sec": "38.33",
|
|
257
285
|
"sample deviation": "0.00"
|
|
258
286
|
}
|
|
259
287
|
],
|
|
@@ -263,31 +291,48 @@
|
|
|
263
291
|
"benchmarks": [
|
|
264
292
|
{
|
|
265
293
|
"test name": "1,000,000 push",
|
|
266
|
-
"time taken (ms)": "45.
|
|
267
|
-
"executions per sec": "
|
|
294
|
+
"time taken (ms)": "45.45",
|
|
295
|
+
"executions per sec": "22.00",
|
|
268
296
|
"sample deviation": "0.01"
|
|
269
297
|
},
|
|
270
298
|
{
|
|
271
299
|
"test name": "1,000,000 push & shift",
|
|
272
|
-
"time taken (ms)": "
|
|
273
|
-
"executions per sec": "12.
|
|
300
|
+
"time taken (ms)": "82.87",
|
|
301
|
+
"executions per sec": "12.07",
|
|
274
302
|
"sample deviation": "0.00"
|
|
275
303
|
}
|
|
276
304
|
],
|
|
277
305
|
"testName": "queue"
|
|
278
306
|
},
|
|
307
|
+
"stack": {
|
|
308
|
+
"benchmarks": [
|
|
309
|
+
{
|
|
310
|
+
"test name": "1,000,000 push",
|
|
311
|
+
"time taken (ms)": "43.95",
|
|
312
|
+
"executions per sec": "22.75",
|
|
313
|
+
"sample deviation": "0.01"
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
"test name": "1,000,000 push & pop",
|
|
317
|
+
"time taken (ms)": "50.91",
|
|
318
|
+
"executions per sec": "19.64",
|
|
319
|
+
"sample deviation": "0.00"
|
|
320
|
+
}
|
|
321
|
+
],
|
|
322
|
+
"testName": "stack"
|
|
323
|
+
},
|
|
279
324
|
"trie": {
|
|
280
325
|
"benchmarks": [
|
|
281
326
|
{
|
|
282
327
|
"test name": "100,000 push",
|
|
283
|
-
"time taken (ms)": "
|
|
284
|
-
"executions per sec": "
|
|
285
|
-
"sample deviation": "0.
|
|
328
|
+
"time taken (ms)": "50.20",
|
|
329
|
+
"executions per sec": "19.92",
|
|
330
|
+
"sample deviation": "0.00"
|
|
286
331
|
},
|
|
287
332
|
{
|
|
288
333
|
"test name": "100,000 getWords",
|
|
289
|
-
"time taken (ms)": "
|
|
290
|
-
"executions per sec": "
|
|
334
|
+
"time taken (ms)": "110.08",
|
|
335
|
+
"executions per sec": "9.08",
|
|
291
336
|
"sample deviation": "0.01"
|
|
292
337
|
}
|
|
293
338
|
],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "data-structure-typed",
|
|
3
|
-
"version": "1.43.
|
|
3
|
+
"version": "1.43.1",
|
|
4
4
|
"description": "Data Structures of Javascript & TypeScript. Binary Tree, BST, Graph, Heap, Priority Queue, Linked List, Queue, Deque, Stack, AVL Tree, Tree Multiset, Trie, Directed Graph, Undirected Graph, Singly Linked List, Doubly Linked List, Max Heap, Max Priority Queue, Min Heap, Min Priority Queue.",
|
|
5
5
|
"main": "dist/cjs/src/index.js",
|
|
6
6
|
"module": "dist/mjs/src/index.js",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"install:all-subs": "npm i avl-tree-typed binary-tree-typed bst-typed deque-typed directed-graph-typed doubly-linked-list-typed graph-typed heap-typed linked-list-typed max-heap-typed max-priority-queue-typed min-heap-typed min-priority-queue-typed priority-queue-typed singly-linked-list-typed stack-typed tree-multimap-typed trie-typed undirected-graph-typed queue-typed --save-dev",
|
|
34
34
|
"test": "jest --runInBand",
|
|
35
35
|
"test:integration": "npm run update:subs && jest --config jest.integration.config.js",
|
|
36
|
-
"
|
|
36
|
+
"test:perf": "ts-node test/performance/reportor.ts",
|
|
37
37
|
"check:deps": "dependency-cruiser src",
|
|
38
38
|
"changelog": "auto-changelog",
|
|
39
39
|
"coverage:badge": "istanbul-badges-readme",
|
|
@@ -78,6 +78,7 @@
|
|
|
78
78
|
"heap-typed": "^1.42.5",
|
|
79
79
|
"istanbul-badges-readme": "^1.8.5",
|
|
80
80
|
"jest": "^29.7.0",
|
|
81
|
+
"js-sdsl": "^4.4.2",
|
|
81
82
|
"prettier": "^3.0.3",
|
|
82
83
|
"ts-jest": "^29.1.1",
|
|
83
84
|
"ts-loader": "^9.4.4",
|
package/test/config.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export const isDebugTest = false;
|
|
1
|
+
export const isDebugTest: boolean = false;
|
|
2
|
+
export const isCompetitor: boolean = false;
|
|
@@ -16,17 +16,6 @@
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
try {
|
|
19
|
-
const {AVLTree, Queue} = window.dataStructureTyped;
|
|
20
|
-
const avlTree = new AVLTree();
|
|
21
|
-
const $avlTree = document.createElement('li');
|
|
22
|
-
const $avlTreeSpan = document.createElement('span');
|
|
23
|
-
$avlTreeSpan.innerText = 'AVLTree';
|
|
24
|
-
$avlTree.append($avlTreeSpan);
|
|
25
|
-
avlTree.add(1, 1);
|
|
26
|
-
console.log(avlTree.bfs());
|
|
27
|
-
$modules.append($avlTree);
|
|
28
|
-
|
|
29
|
-
|
|
30
19
|
const queue = new Queue();
|
|
31
20
|
for (let i = 0; i < 100000; i++) {
|
|
32
21
|
queue.enqueue(i);
|
|
@@ -43,6 +32,22 @@
|
|
|
43
32
|
} catch (e) {
|
|
44
33
|
console.error(e);
|
|
45
34
|
}
|
|
35
|
+
try {
|
|
36
|
+
const {AVLTree} = window.dataStructureTyped;
|
|
37
|
+
const avlTree = new AVLTree();
|
|
38
|
+
const $avlTree = document.createElement('li');
|
|
39
|
+
const $avlTreeSpan = document.createElement('span');
|
|
40
|
+
$avlTreeSpan.innerText = 'AVLTree';
|
|
41
|
+
$avlTree.append($avlTreeSpan);
|
|
42
|
+
for (let i = 1; i < 31; i++) {
|
|
43
|
+
avlTree.add(i, i);
|
|
44
|
+
}
|
|
45
|
+
console.log(avlTree.bfs());
|
|
46
|
+
// avlTree.print();
|
|
47
|
+
$modules.append($avlTree);
|
|
48
|
+
} catch (e) {
|
|
49
|
+
console.error(e);
|
|
50
|
+
}
|
|
46
51
|
|
|
47
52
|
try {
|
|
48
53
|
const {BinaryTree} = dataStructureTyped;
|
|
@@ -66,6 +71,20 @@
|
|
|
66
71
|
} catch (e) {
|
|
67
72
|
console.error(e);
|
|
68
73
|
}
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
try {
|
|
77
|
+
const {RedBlackTree} = dataStructureTyped;
|
|
78
|
+
const tree = new RedBlackTree();
|
|
79
|
+
for (let i = 1; i < 31; i++) {
|
|
80
|
+
tree.add(i, i);
|
|
81
|
+
}
|
|
82
|
+
console.log(tree.isPerfectlyBalanced());
|
|
83
|
+
tree.print();
|
|
84
|
+
|
|
85
|
+
} catch (e) {
|
|
86
|
+
console.error(e);
|
|
87
|
+
}
|
|
69
88
|
</script>
|
|
70
89
|
|
|
71
90
|
</body>
|
|
@@ -1,28 +1,41 @@
|
|
|
1
1
|
import {RedBlackTree} from '../../../../src';
|
|
2
2
|
import * as Benchmark from 'benchmark';
|
|
3
3
|
import {getRandomIntArray, magnitude} from '../../../utils';
|
|
4
|
+
import {OrderedMap} from 'js-sdsl';
|
|
5
|
+
import {isCompetitor} from "../../../config";
|
|
4
6
|
|
|
5
7
|
const suite = new Benchmark.Suite();
|
|
6
8
|
const rbTree = new RedBlackTree();
|
|
7
9
|
const {HUNDRED_THOUSAND} = magnitude;
|
|
8
10
|
const arr = getRandomIntArray(HUNDRED_THOUSAND, 0, HUNDRED_THOUSAND, true);
|
|
11
|
+
const competitor = new OrderedMap<number, number>();
|
|
9
12
|
|
|
10
13
|
suite
|
|
11
|
-
.add(`${HUNDRED_THOUSAND.toLocaleString()} add
|
|
12
|
-
rbTree.clear();
|
|
13
|
-
for (let i = 0; i < arr.length; i++) {
|
|
14
|
-
rbTree.add(arr[i]);
|
|
15
|
-
}
|
|
16
|
-
})
|
|
17
|
-
.add(`${HUNDRED_THOUSAND.toLocaleString()} add & delete randomly`, () => {
|
|
14
|
+
.add(`${HUNDRED_THOUSAND.toLocaleString()} add`, () => {
|
|
18
15
|
rbTree.clear();
|
|
19
16
|
for (let i = 0; i < arr.length; i++) {
|
|
20
17
|
rbTree.add(arr[i]);
|
|
21
18
|
}
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
if (isCompetitor) {
|
|
23
|
+
suite.add(`${HUNDRED_THOUSAND.toLocaleString()} competitor add`, () => {
|
|
22
24
|
for (let i = 0; i < arr.length; i++) {
|
|
23
|
-
|
|
25
|
+
competitor.setElement(arr[i], arr[i]);
|
|
24
26
|
}
|
|
25
27
|
})
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
suite.add(`${HUNDRED_THOUSAND.toLocaleString()} add & delete randomly`, () => {
|
|
31
|
+
rbTree.clear();
|
|
32
|
+
for (let i = 0; i < arr.length; i++) {
|
|
33
|
+
rbTree.add(arr[i]);
|
|
34
|
+
}
|
|
35
|
+
for (let i = 0; i < arr.length; i++) {
|
|
36
|
+
rbTree.delete(arr[i]);
|
|
37
|
+
}
|
|
38
|
+
})
|
|
26
39
|
.add(`${HUNDRED_THOUSAND.toLocaleString()} getNode`, () => {
|
|
27
40
|
for (let i = 0; i < arr.length; i++) {
|
|
28
41
|
rbTree.getNode(arr[i]);
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import {HashMap} from '../../../../src';
|
|
2
|
+
import {HashMap as CHashMap} from 'js-sdsl';
|
|
3
|
+
import * as Benchmark from 'benchmark';
|
|
4
|
+
import {magnitude} from '../../../utils';
|
|
5
|
+
import {isCompetitor} from "../../../config";
|
|
6
|
+
|
|
7
|
+
const suite = new Benchmark.Suite();
|
|
8
|
+
const {TEN_THOUSAND} = magnitude;
|
|
9
|
+
|
|
10
|
+
suite
|
|
11
|
+
.add(`${TEN_THOUSAND.toLocaleString()} set`, () => {
|
|
12
|
+
const hm = new HashMap<number, number>();
|
|
13
|
+
|
|
14
|
+
for (let i = 0; i < TEN_THOUSAND; i++) {
|
|
15
|
+
hm.set(i, i);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
if (isCompetitor) {
|
|
19
|
+
|
|
20
|
+
suite.add(`${TEN_THOUSAND.toLocaleString()} competitor set`, () => {
|
|
21
|
+
const hm = new CHashMap<number, number>();
|
|
22
|
+
|
|
23
|
+
for (let i = 0; i < TEN_THOUSAND; i++) {
|
|
24
|
+
hm.setElement(i, i);
|
|
25
|
+
}
|
|
26
|
+
})
|
|
27
|
+
}
|
|
28
|
+
suite.add(`${TEN_THOUSAND.toLocaleString()} set & get`, () => {
|
|
29
|
+
const hm = new HashMap<number, number>();
|
|
30
|
+
|
|
31
|
+
for (let i = 0; i < TEN_THOUSAND; i++) {
|
|
32
|
+
hm.set(i, i);
|
|
33
|
+
}
|
|
34
|
+
for (let i = 0; i < TEN_THOUSAND; i++) {
|
|
35
|
+
hm.get(i);
|
|
36
|
+
}
|
|
37
|
+
})
|
|
38
|
+
;
|
|
39
|
+
if (isCompetitor) {
|
|
40
|
+
suite.add(`${TEN_THOUSAND.toLocaleString()} competitor set & get`, () => {
|
|
41
|
+
const hm = new CHashMap<number, number>();
|
|
42
|
+
|
|
43
|
+
for (let i = 0; i < TEN_THOUSAND; i++) {
|
|
44
|
+
hm.setElement(i, i);
|
|
45
|
+
}
|
|
46
|
+
for (let i = 0; i < TEN_THOUSAND; i++) {
|
|
47
|
+
hm.getElementByKey(i);
|
|
48
|
+
}
|
|
49
|
+
})
|
|
50
|
+
}
|
|
51
|
+
export {suite};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import {DoublyLinkedList, DoublyLinkedListNode} from '../../../../src';
|
|
2
|
+
import {LinkList as CLinkedList} from 'js-sdsl';
|
|
2
3
|
import * as Benchmark from 'benchmark';
|
|
3
4
|
import {magnitude} from '../../../utils';
|
|
5
|
+
import {isCompetitor} from "../../../config";
|
|
4
6
|
|
|
5
7
|
const suite = new Benchmark.Suite();
|
|
6
8
|
const {LINEAR} = magnitude;
|
|
@@ -13,7 +15,16 @@ suite
|
|
|
13
15
|
list.unshift(i);
|
|
14
16
|
}
|
|
15
17
|
})
|
|
16
|
-
|
|
18
|
+
if (isCompetitor) {
|
|
19
|
+
suite.add(`${LINEAR.toLocaleString()} competitor unshift`, () => {
|
|
20
|
+
const list = new CLinkedList<number>();
|
|
21
|
+
|
|
22
|
+
for (let i = 0; i < LINEAR; i++) {
|
|
23
|
+
list.pushFront(i);
|
|
24
|
+
}
|
|
25
|
+
})
|
|
26
|
+
}
|
|
27
|
+
suite.add(`${LINEAR.toLocaleString()} unshift & shift`, () => {
|
|
17
28
|
const list = new DoublyLinkedList<number>();
|
|
18
29
|
|
|
19
30
|
for (let i = 0; i < LINEAR; i++) {
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import {PriorityQueue as CPriorityQueue} from 'js-sdsl';
|
|
2
|
+
import {PriorityQueue} from '../../../../src';
|
|
3
|
+
import * as Benchmark from 'benchmark';
|
|
4
|
+
import {magnitude} from '../../../utils';
|
|
5
|
+
import {isCompetitor} from "../../../config";
|
|
6
|
+
|
|
7
|
+
const suite = new Benchmark.Suite();
|
|
8
|
+
const {TEN_THOUSAND} = magnitude;
|
|
9
|
+
|
|
10
|
+
suite
|
|
11
|
+
.add(`${TEN_THOUSAND.toLocaleString()} add & pop`, () => {
|
|
12
|
+
const pq = new PriorityQueue<number>({comparator: (a, b) => b - a});
|
|
13
|
+
|
|
14
|
+
for (let i = 0; i < TEN_THOUSAND; i++) {
|
|
15
|
+
pq.add(i);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
for (let i = 0; i < TEN_THOUSAND; i++) {
|
|
19
|
+
pq.pop();
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
if (isCompetitor) {
|
|
23
|
+
suite.add(`${TEN_THOUSAND.toLocaleString()} competitor add & pop`, () => {
|
|
24
|
+
const pq = new CPriorityQueue<number>();
|
|
25
|
+
|
|
26
|
+
for (let i = 0; i < TEN_THOUSAND; i++) {
|
|
27
|
+
pq.push(i);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
for (let i = 0; i < TEN_THOUSAND; i++) {
|
|
31
|
+
pq.pop();
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export {suite};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import {Deque} from '../../../../src';
|
|
2
|
+
import {Deque as CDeque} from 'js-sdsl';
|
|
2
3
|
import * as Benchmark from 'benchmark';
|
|
3
4
|
import {magnitude} from '../../../utils';
|
|
5
|
+
import {isCompetitor} from "../../../config";
|
|
4
6
|
|
|
5
7
|
export const suite = new Benchmark.Suite();
|
|
6
8
|
const {LINEAR} = magnitude;
|
|
@@ -12,7 +14,15 @@ suite
|
|
|
12
14
|
deque.push(i);
|
|
13
15
|
}
|
|
14
16
|
})
|
|
15
|
-
|
|
17
|
+
if (isCompetitor) {
|
|
18
|
+
suite.add(`${LINEAR.toLocaleString()} competitor push`, () => {
|
|
19
|
+
const deque = new CDeque<number>();
|
|
20
|
+
for (let i = 0; i < LINEAR; i++) {
|
|
21
|
+
deque.pushBack(i);
|
|
22
|
+
}
|
|
23
|
+
})
|
|
24
|
+
}
|
|
25
|
+
suite.add(`${LINEAR.toLocaleString()} shift`, () => {
|
|
16
26
|
const deque = new Deque<number>();
|
|
17
27
|
for (let i = 0; i < LINEAR; i++) {
|
|
18
28
|
deque.push(i);
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import {Queue} from '../../../../src';
|
|
2
|
+
import {Queue as CQueue} from 'js-sdsl';
|
|
2
3
|
import * as Benchmark from 'benchmark';
|
|
3
4
|
import {magnitude} from '../../../utils';
|
|
5
|
+
import {isCompetitor} from "../../../config";
|
|
4
6
|
|
|
5
7
|
const suite = new Benchmark.Suite();
|
|
6
8
|
const {LINEAR} = magnitude;
|
|
@@ -13,7 +15,16 @@ suite
|
|
|
13
15
|
queue.push(i);
|
|
14
16
|
}
|
|
15
17
|
})
|
|
16
|
-
|
|
18
|
+
if (isCompetitor) {
|
|
19
|
+
suite.add(`${LINEAR.toLocaleString()} competitor push`, () => {
|
|
20
|
+
const queue = new CQueue<number>();
|
|
21
|
+
|
|
22
|
+
for (let i = 0; i < LINEAR; i++) {
|
|
23
|
+
queue.push(i);
|
|
24
|
+
}
|
|
25
|
+
})
|
|
26
|
+
}
|
|
27
|
+
suite.add(`${LINEAR.toLocaleString()} push & shift`, () => {
|
|
17
28
|
const queue = new Queue<number>();
|
|
18
29
|
|
|
19
30
|
for (let i = 0; i < LINEAR; i++) {
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import {Stack} from '../../../../src';
|
|
2
|
+
import {Stack as CStack} from 'js-sdsl';
|
|
3
|
+
import * as Benchmark from 'benchmark';
|
|
4
|
+
import {magnitude} from '../../../utils';
|
|
5
|
+
import {isCompetitor} from "../../../config";
|
|
6
|
+
|
|
7
|
+
const suite = new Benchmark.Suite();
|
|
8
|
+
const {LINEAR} = magnitude;
|
|
9
|
+
|
|
10
|
+
suite
|
|
11
|
+
.add(`${LINEAR.toLocaleString()} push`, () => {
|
|
12
|
+
const stack = new Stack<number>();
|
|
13
|
+
|
|
14
|
+
for (let i = 0; i < LINEAR; i++) {
|
|
15
|
+
stack.push(i);
|
|
16
|
+
}
|
|
17
|
+
})
|
|
18
|
+
if (isCompetitor) {
|
|
19
|
+
suite.add(`${LINEAR.toLocaleString()} competitor push`, () => {
|
|
20
|
+
const queue = new CStack<number>();
|
|
21
|
+
|
|
22
|
+
for (let i = 0; i < LINEAR; i++) {
|
|
23
|
+
queue.push(i);
|
|
24
|
+
}
|
|
25
|
+
})
|
|
26
|
+
}
|
|
27
|
+
suite.add(`${LINEAR.toLocaleString()} push & pop`, () => {
|
|
28
|
+
const queue = new Stack<number>();
|
|
29
|
+
|
|
30
|
+
for (let i = 0; i < LINEAR; i++) {
|
|
31
|
+
queue.push(i);
|
|
32
|
+
}
|
|
33
|
+
for (let i = 0; i < LINEAR; i++) {
|
|
34
|
+
queue.pop();
|
|
35
|
+
}
|
|
36
|
+
})
|
|
37
|
+
if (isCompetitor) {
|
|
38
|
+
suite.add(`${LINEAR.toLocaleString()} competitor push & pop`, () => {
|
|
39
|
+
const queue = new CStack<number>();
|
|
40
|
+
|
|
41
|
+
for (let i = 0; i < LINEAR; i++) {
|
|
42
|
+
queue.push(i);
|
|
43
|
+
}
|
|
44
|
+
for (let i = 0; i < LINEAR; i++) {
|
|
45
|
+
queue.pop();
|
|
46
|
+
}
|
|
47
|
+
})
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export {suite};
|