chore: To avoid sacrificing performance, UMD modules use ES6 style.

This commit is contained in:
Revone 2023-11-20 19:24:53 +08:00
parent 92552da31c
commit d6e186a884
4 changed files with 47 additions and 40 deletions

View file

@ -760,52 +760,52 @@ Array.from(dijkstraResult?.seen ?? []).map(vertex => vertex.key) // ['A', 'B', '
[//]: # (No deletion!!! Start of Replace Section)
<div class="json-to-html-collapse clearfix 0">
<div class='collapsible level0' ><span class='json-to-html-label'>comparison</span></div>
<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>SRC 10,000 add</td><td>0.57</td><td>1745.58</td><td>5.41e-6</td></tr><tr><td>CJS 10,000 add</td><td>0.57</td><td>1751.77</td><td>4.80e-6</td></tr><tr><td>MJS 10,000 add</td><td>0.57</td><td>1749.46</td><td>6.15e-6</td></tr><tr><td>SRC PQ 10,000 add & pop</td><td>3.42</td><td>292.80</td><td>2.97e-5</td></tr><tr><td>CJS PQ 10,000 add & pop</td><td>3.40</td><td>293.71</td><td>3.10e-5</td></tr><tr><td>MJS PQ 10,000 add & pop</td><td>3.41</td><td>293.62</td><td>3.51e-5</td></tr></table></div>
<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>SRC 10,000 add</td><td>0.57</td><td>1745.63</td><td>5.99e-6</td></tr><tr><td>CJS 10,000 add</td><td>0.57</td><td>1746.43</td><td>5.30e-6</td></tr><tr><td>MJS 10,000 add</td><td>0.58</td><td>1724.97</td><td>5.73e-5</td></tr><tr><td>CPT PQ 10,000 add</td><td>0.57</td><td>1745.61</td><td>7.49e-6</td></tr><tr><td>SRC PQ 10,000 add & pop</td><td>3.42</td><td>292.15</td><td>3.23e-5</td></tr><tr><td>CJS PQ 10,000 add & pop</td><td>3.37</td><td>296.36</td><td>3.64e-5</td></tr><tr><td>MJS PQ 10,000 add & pop</td><td>3.37</td><td>296.66</td><td>3.48e-5</td></tr><tr><td>CPT PQ 10,000 add & pop</td><td>2.07</td><td>482.94</td><td>2.10e-5</td></tr><tr><td>CPT OM 100,000 add</td><td>44.47</td><td>22.49</td><td>0.00</td></tr><tr><td>CPT HM 10,000 set</td><td>0.58</td><td>1716.99</td><td>1.45e-5</td></tr><tr><td>CPT HM 10,000 set & get</td><td>0.67</td><td>1491.78</td><td>1.61e-5</td></tr><tr><td>CPT LL 1,000,000 unshift</td><td>67.95</td><td>14.72</td><td>0.02</td></tr><tr><td>CPT PQ 10,000 add & pop</td><td>2.09</td><td>478.64</td><td>9.70e-5</td></tr><tr><td>CPT DQ 1,000,000 push</td><td>14.50</td><td>68.96</td><td>2.78e-4</td></tr><tr><td>CPT Q 1,000,000 push</td><td>47.51</td><td>21.05</td><td>0.00</td></tr><tr><td>CPT ST 1,000,000 push</td><td>42.03</td><td>23.79</td><td>0.01</td></tr><tr><td>CPT ST 1,000,000 push & pop</td><td>48.84</td><td>20.48</td><td>0.00</td></tr></table></div>
</div><div class="json-to-html-collapse clearfix 0">
<div class='collapsible level0' ><span class='json-to-html-label'>avl-tree</span></div>
<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>31.25</td><td>32.00</td><td>3.13e-4</td></tr><tr><td>10,000 add & delete randomly</td><td>71.87</td><td>13.91</td><td>0.00</td></tr><tr><td>10,000 addMany</td><td>41.06</td><td>24.36</td><td>4.25e-4</td></tr><tr><td>10,000 get</td><td>28.10</td><td>35.59</td><td>2.51e-4</td></tr></table></div>
<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>30.95</td><td>32.32</td><td>4.46e-4</td></tr><tr><td>10,000 add & delete randomly</td><td>70.84</td><td>14.12</td><td>0.00</td></tr><tr><td>10,000 addMany</td><td>40.64</td><td>24.61</td><td>3.31e-4</td></tr><tr><td>10,000 get</td><td>27.92</td><td>35.81</td><td>2.07e-4</td></tr></table></div>
</div><div class="json-to-html-collapse clearfix 0">
<div class='collapsible level0' ><span class='json-to-html-label'>binary-tree</span></div>
<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.02</td><td>76.79</td><td>1.25e-4</td></tr><tr><td>1,000 add & delete randomly</td><td>15.86</td><td>63.05</td><td>1.08e-4</td></tr><tr><td>1,000 addMany</td><td>10.26</td><td>97.46</td><td>7.97e-5</td></tr><tr><td>1,000 get</td><td>18.35</td><td>54.49</td><td>3.12e-4</td></tr><tr><td>1,000 dfs</td><td>154.50</td><td>6.47</td><td>7.28e-4</td></tr><tr><td>1,000 bfs</td><td>56.53</td><td>17.69</td><td>3.74e-4</td></tr><tr><td>1,000 morris</td><td>257.07</td><td>3.89</td><td>0.00</td></tr></table></div>
<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>12.85</td><td>77.80</td><td>3.77e-4</td></tr><tr><td>1,000 add & delete randomly</td><td>15.73</td><td>63.57</td><td>1.51e-4</td></tr><tr><td>1,000 addMany</td><td>10.15</td><td>98.50</td><td>9.02e-5</td></tr><tr><td>1,000 get</td><td>18.20</td><td>54.95</td><td>3.43e-4</td></tr><tr><td>1,000 dfs</td><td>152.06</td><td>6.58</td><td>7.60e-4</td></tr><tr><td>1,000 bfs</td><td>55.85</td><td>17.91</td><td>3.14e-4</td></tr><tr><td>1,000 morris</td><td>256.13</td><td>3.90</td><td>9.73e-4</td></tr></table></div>
</div><div class="json-to-html-collapse clearfix 0">
<div class='collapsible level0' ><span class='json-to-html-label'>bst</span></div>
<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>28.25</td><td>35.40</td><td>3.07e-4</td></tr><tr><td>10,000 add & delete randomly</td><td>67.69</td><td>14.77</td><td>8.51e-4</td></tr><tr><td>10,000 addMany</td><td>29.25</td><td>34.19</td><td>0.00</td></tr><tr><td>10,000 get</td><td>28.77</td><td>34.76</td><td>2.55e-4</td></tr></table></div>
<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>27.96</td><td>35.76</td><td>2.98e-4</td></tr><tr><td>10,000 add & delete randomly</td><td>66.96</td><td>14.93</td><td>7.52e-4</td></tr><tr><td>10,000 addMany</td><td>29.42</td><td>33.99</td><td>3.30e-4</td></tr><tr><td>10,000 get</td><td>28.55</td><td>35.03</td><td>1.99e-4</td></tr></table></div>
</div><div class="json-to-html-collapse clearfix 0">
<div class='collapsible level0' ><span class='json-to-html-label'>rb-tree</span></div>
<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>86.88</td><td>11.51</td><td>0.00</td></tr><tr><td>100,000 add & delete randomly</td><td>215.71</td><td>4.64</td><td>0.00</td></tr><tr><td>100,000 getNode</td><td>40.78</td><td>24.52</td><td>3.22e-4</td></tr></table></div>
<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>87.42</td><td>11.44</td><td>0.00</td></tr><tr><td>100,000 CPT add</td><td>44.17</td><td>22.64</td><td>0.00</td></tr><tr><td>100,000 add & delete randomly</td><td>220.91</td><td>4.53</td><td>0.02</td></tr><tr><td>100,000 getNode</td><td>40.48</td><td>24.70</td><td>5.58e-4</td></tr></table></div>
</div><div class="json-to-html-collapse clearfix 0">
<div class='collapsible level0' ><span class='json-to-html-label'>directed-graph</span></div>
<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.10</td><td>9992.98</td><td>8.63e-7</td></tr><tr><td>1,000 addEdge</td><td>6.11</td><td>163.74</td><td>1.31e-4</td></tr><tr><td>1,000 getVertex</td><td>0.05</td><td>2.16e+4</td><td>6.15e-7</td></tr><tr><td>1,000 getEdge</td><td>23.01</td><td>43.45</td><td>0.00</td></tr><tr><td>tarjan</td><td>222.33</td><td>4.50</td><td>0.02</td></tr><tr><td>tarjan all</td><td>224.99</td><td>4.44</td><td>0.02</td></tr><tr><td>topologicalSort</td><td>177.80</td><td>5.62</td><td>0.01</td></tr></table></div>
<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.10</td><td>9667.55</td><td>9.48e-7</td></tr><tr><td>1,000 addEdge</td><td>6.17</td><td>161.99</td><td>1.79e-4</td></tr><tr><td>1,000 getVertex</td><td>0.05</td><td>2.17e+4</td><td>3.52e-7</td></tr><tr><td>1,000 getEdge</td><td>23.52</td><td>42.51</td><td>0.00</td></tr><tr><td>tarjan</td><td>220.31</td><td>4.54</td><td>0.01</td></tr><tr><td>tarjan all</td><td>224.17</td><td>4.46</td><td>0.00</td></tr><tr><td>topologicalSort</td><td>192.50</td><td>5.19</td><td>0.03</td></tr></table></div>
</div><div class="json-to-html-collapse clearfix 0">
<div class='collapsible level0' ><span class='json-to-html-label'>hash-map</span></div>
<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>0.99</td><td>1006.45</td><td>2.07e-5</td></tr><tr><td>10,000 set & get</td><td>1.49</td><td>669.20</td><td>2.66e-5</td></tr></table></div>
<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 set</td><td>269.88</td><td>3.71</td><td>0.04</td></tr><tr><td>1,000,000 CPT set</td><td>251.08</td><td>3.98</td><td>0.05</td></tr><tr><td>1,000,000 Map set</td><td>214.03</td><td>4.67</td><td>0.02</td></tr><tr><td>1,000,000 Set add</td><td>170.84</td><td>5.85</td><td>0.01</td></tr><tr><td>1,000,000 set & get</td><td>404.20</td><td>2.47</td><td>0.06</td></tr><tr><td>1,000,000 CPT set & get</td><td>279.39</td><td>3.58</td><td>0.07</td></tr><tr><td>1,000,000 Map set & get</td><td>269.85</td><td>3.71</td><td>0.01</td></tr><tr><td>1,000,000 Set add & has</td><td>202.46</td><td>4.94</td><td>0.12</td></tr><tr><td>1,000,000 ObjKey set & get</td><td>891.01</td><td>1.12</td><td>0.03</td></tr><tr><td>1,000,000 Map ObjKey set & get</td><td>316.41</td><td>3.16</td><td>0.05</td></tr><tr><td>1,000,000 Set ObjKey add & has</td><td>277.27</td><td>3.61</td><td>0.03</td></tr></table></div>
</div><div class="json-to-html-collapse clearfix 0">
<div class='collapsible level0' ><span class='json-to-html-label'>heap</span></div>
<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>5.78</td><td>172.88</td><td>4.96e-5</td></tr><tr><td>10,000 fib add & pop</td><td>357.91</td><td>2.79</td><td>0.01</td></tr></table></div>
<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>5.89</td><td>169.67</td><td>2.36e-4</td></tr><tr><td>10,000 fib add & pop</td><td>362.10</td><td>2.76</td><td>0.00</td></tr></table></div>
</div><div class="json-to-html-collapse clearfix 0">
<div class='collapsible level0' ><span class='json-to-html-label'>doubly-linked-list</span></div>
<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>207.57</td><td>4.82</td><td>0.04</td></tr><tr><td>1,000,000 unshift</td><td>224.17</td><td>4.46</td><td>0.10</td></tr><tr><td>1,000,000 unshift & shift</td><td>170.27</td><td>5.87</td><td>0.04</td></tr><tr><td>1,000,000 insertBefore</td><td>325.71</td><td>3.07</td><td>0.08</td></tr></table></div>
<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>234.96</td><td>4.26</td><td>0.07</td></tr><tr><td>1,000,000 CPT push</td><td>83.46</td><td>11.98</td><td>0.04</td></tr><tr><td>1,000,000 unshift</td><td>220.58</td><td>4.53</td><td>0.03</td></tr><tr><td>1,000,000 CPT unshift</td><td>73.26</td><td>13.65</td><td>0.03</td></tr><tr><td>1,000,000 unshift & shift</td><td>168.56</td><td>5.93</td><td>0.01</td></tr><tr><td>1,000,000 insertBefore</td><td>330.81</td><td>3.02</td><td>0.04</td></tr></table></div>
</div><div class="json-to-html-collapse clearfix 0">
<div class='collapsible level0' ><span class='json-to-html-label'>singly-linked-list</span></div>
<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>223.42</td><td>4.48</td><td>0.02</td></tr><tr><td>10,000 insertBefore</td><td>253.67</td><td>3.94</td><td>0.02</td></tr></table></div>
<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>216.94</td><td>4.61</td><td>0.02</td></tr><tr><td>10,000 insertBefore</td><td>248.68</td><td>4.02</td><td>0.00</td></tr></table></div>
</div><div class="json-to-html-collapse clearfix 0">
<div class='collapsible level0' ><span class='json-to-html-label'>max-priority-queue</span></div>
<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>10.51</td><td>95.16</td><td>0.01</td></tr></table></div>
<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>8.78</td><td>113.94</td><td>1.48e-4</td></tr></table></div>
</div><div class="json-to-html-collapse clearfix 0">
<div class='collapsible level0' ><span class='json-to-html-label'>priority-queue</span></div>
<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 & pop</td><td>105.61</td><td>9.47</td><td>0.00</td></tr></table></div>
<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 & pop</td><td>103.20</td><td>9.69</td><td>0.00</td></tr><tr><td>100,000 CPT add & pop</td><td>27.41</td><td>36.49</td><td>7.73e-4</td></tr></table></div>
</div><div class="json-to-html-collapse clearfix 0">
<div class='collapsible level0' ><span class='json-to-html-label'>deque</span></div>
<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>14.01</td><td>71.39</td><td>4.74e-4</td></tr><tr><td>1,000,000 push & pop</td><td>23.12</td><td>43.25</td><td>6.61e-4</td></tr><tr><td>1,000,000 push & shift</td><td>25.00</td><td>40.00</td><td>0.01</td></tr><tr><td>1,000,000 unshift & shift</td><td>22.04</td><td>45.38</td><td>2.90e-4</td></tr></table></div>
<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>13.99</td><td>71.46</td><td>2.13e-4</td></tr><tr><td>1,000,000 CPT push</td><td>13.36</td><td>74.88</td><td>1.70e-4</td></tr><tr><td>1,000,000 push & pop</td><td>23.47</td><td>42.61</td><td>0.01</td></tr><tr><td>1,000,000 push & shift</td><td>24.19</td><td>41.34</td><td>0.00</td></tr><tr><td>1,000,000 unshift & shift</td><td>22.13</td><td>45.19</td><td>5.99e-4</td></tr></table></div>
</div><div class="json-to-html-collapse clearfix 0">
<div class='collapsible level0' ><span class='json-to-html-label'>queue</span></div>
<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>48.25</td><td>20.72</td><td>0.01</td></tr><tr><td>1,000,000 push & shift</td><td>83.38</td><td>11.99</td><td>0.00</td></tr></table></div>
<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>37.01</td><td>27.02</td><td>9.55e-4</td></tr><tr><td>1,000,000 CPT push</td><td>43.81</td><td>22.82</td><td>0.01</td></tr><tr><td>1,000,000 push & shift</td><td>81.31</td><td>12.30</td><td>0.00</td></tr></table></div>
</div><div class="json-to-html-collapse clearfix 0">
<div class='collapsible level0' ><span class='json-to-html-label'>stack</span></div>
<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.02</td><td>22.21</td><td>0.01</td></tr><tr><td>1,000,000 push & pop</td><td>58.63</td><td>17.06</td><td>0.03</td></tr></table></div>
<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>37.88</td><td>26.40</td><td>0.00</td></tr><tr><td>1,000,000 CPT push</td><td>39.17</td><td>25.53</td><td>0.00</td></tr><tr><td>1,000,000 push & pop</td><td>46.24</td><td>21.63</td><td>0.00</td></tr><tr><td>1,000,000 CPT push & pop</td><td>47.16</td><td>21.21</td><td>0.00</td></tr></table></div>
</div><div class="json-to-html-collapse clearfix 0">
<div class='collapsible level0' ><span class='json-to-html-label'>trie</span></div>
<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>44.82</td><td>22.31</td><td>0.00</td></tr><tr><td>100,000 getWords</td><td>111.82</td><td>8.94</td><td>0.05</td></tr></table></div>
<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>42.84</td><td>23.35</td><td>8.44e-4</td></tr><tr><td>100,000 getWords</td><td>92.26</td><td>10.84</td><td>0.01</td></tr></table></div>
</div>
[//]: # (No deletion!!! End of Replace Section)

View file

@ -4,6 +4,7 @@
<meta charset='UTF-8'>
<title>CDN Test</title>
<script src="../../dist/umd/data-structure-typed.min.js"></script>
<!-- <script src="../../dist/umd/data-structure-typed.js"></script>-->
<!-- <script src='https://cdn.jsdelivr.net/npm/data-structure-typed/dist/umd/data-structure-typed.min.js'></script>-->
<!-- <script src='https://cdn.jsdelivr.net/npm/data-structure-typed@1.42.2/dist/umd/data-structure-typed.min.js'></script>-->
<!-- <script src='https://cdn.jsdelivr.net/npm/data-structure-typed@1.43.3/dist/umd/data-structure-typed.min.js'></script>-->

View file

@ -20,19 +20,22 @@ const { TEN_THOUSAND, HUNDRED_THOUSAND, LINEAR } = magnitude;
const cOrderedMap = new OrderedMap<number, number>();
const arrHundredThousand = getRandomIntArray(HUNDRED_THOUSAND, 0, HUNDRED_THOUSAND, true);
suite.add(`SRC ${TEN_THOUSAND.toLocaleString()} add`, () => {
suite
.add(`SRC PQ ${TEN_THOUSAND.toLocaleString()} add`, () => {
const pq = new SRCPriorityQueue<number>({ comparator: (a, b) => b - a });
for (let i = 0; i < TEN_THOUSAND; i++) pq.add(i);
}).add(`CJS ${TEN_THOUSAND.toLocaleString()} add`, () => {
const pq = new SRCPriorityQueue<number>({ comparator: (a, b) => b - a });
for (let i = 0; i < TEN_THOUSAND; i++) pq.add(i);
})
.add(`CJS PQ ${TEN_THOUSAND.toLocaleString()} add`, () => {
const pq = new CJSPriorityQueue<number>({ comparator: (a, b) => b - a });
for (let i = 0; i < TEN_THOUSAND; i++) pq.add(i);
}).add(`MJS ${TEN_THOUSAND.toLocaleString()} add`, () => {
const pq = new CJSPriorityQueue<number>({ comparator: (a, b) => b - a });
for (let i = 0; i < TEN_THOUSAND; i++) pq.add(i);
})
.add(`MJS PQ ${TEN_THOUSAND.toLocaleString()} add`, () => {
const pq = new MJSPriorityQueue<number>({ comparator: (a, b) => b - a });
for (let i = 0; i < TEN_THOUSAND; i++) pq.add(i);
});
const pq = new MJSPriorityQueue<number>({ comparator: (a, b) => b - a });
for (let i = 0; i < TEN_THOUSAND; i++) pq.add(i);
});
if (isCompetitor) {
suite.add(`CPT PQ ${TEN_THOUSAND.toLocaleString()} add`, () => {
@ -42,22 +45,25 @@ if (isCompetitor) {
});
}
suite.add(`SRC PQ ${TEN_THOUSAND.toLocaleString()} add & pop`, () => {
const pq = new SRCPriorityQueue<number>({ comparator: (a, b) => b - a });
suite
.add(`SRC PQ ${TEN_THOUSAND.toLocaleString()} add & pop`, () => {
const pq = new SRCPriorityQueue<number>({ comparator: (a, b) => b - a });
for (let i = 0; i < TEN_THOUSAND; i++) pq.add(i);
for (let i = 0; i < TEN_THOUSAND; i++) pq.pop();
}).add(`CJS PQ ${TEN_THOUSAND.toLocaleString()} add & pop`, () => {
const pq = new CJSPriorityQueue<number>({ comparator: (a, b) => b - a });
for (let i = 0; i < TEN_THOUSAND; i++) pq.add(i);
for (let i = 0; i < TEN_THOUSAND; i++) pq.pop();
})
.add(`CJS PQ ${TEN_THOUSAND.toLocaleString()} add & pop`, () => {
const pq = new CJSPriorityQueue<number>({ comparator: (a, b) => b - a });
for (let i = 0; i < TEN_THOUSAND; i++) pq.add(i);
for (let i = 0; i < TEN_THOUSAND; i++) pq.pop();
}).add(`MJS PQ ${TEN_THOUSAND.toLocaleString()} add & pop`, () => {
const pq = new MJSPriorityQueue<number>({ comparator: (a, b) => b - a });
for (let i = 0; i < TEN_THOUSAND; i++) pq.add(i);
for (let i = 0; i < TEN_THOUSAND; i++) pq.pop();
})
.add(`MJS PQ ${TEN_THOUSAND.toLocaleString()} add & pop`, () => {
const pq = new MJSPriorityQueue<number>({ comparator: (a, b) => b - a });
for (let i = 0; i < TEN_THOUSAND; i++) pq.add(i);
for (let i = 0; i < TEN_THOUSAND; i++) pq.pop();
});
for (let i = 0; i < TEN_THOUSAND; i++) pq.add(i);
for (let i = 0; i < TEN_THOUSAND; i++) pq.pop();
});
if (isCompetitor) {

View file

@ -3,7 +3,7 @@ export default [
entryPoints: {
"data-structure-typed": "src/index.ts"
},
target: 'es5',
target: 'es6',
format: ["iife"],
clean: true,
sourcemap: true,