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 nametime taken (ms)executions per secsample deviation
SRC 10,000 add0.571745.585.41e-6
CJS 10,000 add0.571751.774.80e-6
MJS 10,000 add0.571749.466.15e-6
SRC PQ 10,000 add & pop3.42292.802.97e-5
CJS PQ 10,000 add & pop3.40293.713.10e-5
MJS PQ 10,000 add & pop3.41293.623.51e-5
+
+
avl-tree
+
test nametime taken (ms)executions per secsample deviation
10,000 add randomly31.2532.003.13e-4
10,000 add & delete randomly71.8713.910.00
10,000 addMany41.0624.364.25e-4
10,000 get28.1035.592.51e-4
+
+
binary-tree
+
test nametime taken (ms)executions per secsample deviation
1,000 add randomly13.0276.791.25e-4
1,000 add & delete randomly15.8663.051.08e-4
1,000 addMany10.2697.467.97e-5
1,000 get18.3554.493.12e-4
1,000 dfs154.506.477.28e-4
1,000 bfs56.5317.693.74e-4
1,000 morris257.073.890.00
+
+
bst
+
test nametime taken (ms)executions per secsample deviation
10,000 add randomly28.2535.403.07e-4
10,000 add & delete randomly67.6914.778.51e-4
10,000 addMany29.2534.190.00
10,000 get28.7734.762.55e-4
+
+
rb-tree
+
test nametime taken (ms)executions per secsample deviation
100,000 add86.8811.510.00
100,000 add & delete randomly215.714.640.00
100,000 getNode40.7824.523.22e-4
+
+
directed-graph
+
test nametime taken (ms)executions per secsample deviation
1,000 addVertex0.109992.988.63e-7
1,000 addEdge6.11163.741.31e-4
1,000 getVertex0.052.16e+46.15e-7
1,000 getEdge23.0143.450.00
tarjan222.334.500.02
tarjan all224.994.440.02
topologicalSort177.805.620.01
+
+
hash-map
+
test nametime taken (ms)executions per secsample deviation
10,000 set0.991006.452.07e-5
10,000 set & get1.49669.202.66e-5
+
+
heap
+
test nametime taken (ms)executions per secsample deviation
10,000 add & pop5.78172.884.96e-5
10,000 fib add & pop357.912.790.01
+
+
doubly-linked-list
+
test nametime taken (ms)executions per secsample deviation
1,000,000 push207.574.820.04
1,000,000 unshift224.174.460.10
1,000,000 unshift & shift170.275.870.04
1,000,000 insertBefore325.713.070.08
+
+
singly-linked-list
+
test nametime taken (ms)executions per secsample deviation
10,000 push & pop223.424.480.02
10,000 insertBefore253.673.940.02
+
+
max-priority-queue
+
test nametime taken (ms)executions per secsample deviation
10,000 refill & poll10.5195.160.01
+
+
priority-queue
+
test nametime taken (ms)executions per secsample deviation
100,000 add & pop105.619.470.00
+
deque
-
test nametime taken (ms)executions per secsample deviation
1,000,000 push13.4974.161.40e-4
1,000,000 push & pop22.4844.480.00
1,000,000 push & shift23.4242.711.59e-4
1,000,000 unshift & shift21.6246.252.77e-4
+
test nametime taken (ms)executions per secsample deviation
1,000,000 push14.0171.394.74e-4
1,000,000 push & pop23.1243.256.61e-4
1,000,000 push & shift25.0040.000.01
1,000,000 unshift & shift22.0445.382.90e-4
+
+
queue
+
test nametime taken (ms)executions per secsample deviation
1,000,000 push48.2520.720.01
1,000,000 push & shift83.3811.990.00
+
+
stack
+
test nametime taken (ms)executions per secsample deviation
1,000,000 push45.0222.210.01
1,000,000 push & pop58.6317.060.03
+
+
trie
+
test nametime taken (ms)executions per secsample deviation
100,000 push44.8222.310.00
100,000 getWords111.828.940.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 += ` `; - replaceMarkdownContent( + if (!isIndividual) replaceMarkdownContent( '[//]: # (No deletion!!! Start of Replace Section)', // Start tag '[//]: # (No deletion!!! End of Replace Section)', // end identifier htmlTables // New content to be inserted