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