diff --git a/README.md b/README.md
index d64848f..cac3c3b 100644
--- a/README.md
+++ b/README.md
@@ -807,8 +807,53 @@ 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 |
+
+
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 |
+
+
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 |
+
+
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 |
+
+
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 |
+
+
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 |
+
+
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 |
+
+
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 |
+
+
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 |
+
+
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 |
+
+
max-priority-queue
+
test name | time taken (ms) | executions per sec | sample deviation |
---|
10,000 refill & poll | 10.51 | 95.16 | 0.01 |
+
+
priority-queue
+
test name | time taken (ms) | executions per sec | sample deviation |
---|
100,000 add & pop | 105.61 | 9.47 | 0.00 |
+
deque
-
test name | time taken (ms) | executions per sec | sample deviation |
---|
1,000,000 push | 13.49 | 74.16 | 1.40e-4 |
1,000,000 push & pop | 22.48 | 44.48 | 0.00 |
1,000,000 push & shift | 23.42 | 42.71 | 1.59e-4 |
1,000,000 unshift & shift | 21.62 | 46.25 | 2.77e-4 |
+
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 |
+
+
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 |
+
+
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 |
+
+
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 |
[//]: # (No deletion!!! End of Replace Section)
diff --git a/test/performance/reportor.ts b/test/performance/reportor.ts
index 447fa87..4cf2be6 100644
--- a/test/performance/reportor.ts
+++ b/test/performance/reportor.ts
@@ -25,17 +25,20 @@ const reportDistPath = path.join(parentDirectory, 'benchmark');
const testDir = path.join(__dirname, 'data-structures');
const allFiles = fastGlob.sync(path.join(testDir, '**', '*.test.ts'));
-let testFiles: string[] = [];
+let testFiles: string[];
+
+let isIndividual = false;
if (args.length > 0) {
console.log(`arguments: ${args.join(' ')}`)
testFiles = allFiles.filter(file =>
args.every(word => file.includes(word))
);
-
+ isIndividual = true;
console.log(`${testFiles.map(file => coloredLabeled('Matched', file)).join(`
`)}`);
} else {
+ isIndividual = false;
testFiles = allFiles;
}
@@ -129,7 +132,7 @@ const composeReport = () => {
html += `