overtake 0.0.7 → 0.0.8

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/README.md CHANGED
@@ -14,6 +14,7 @@ Performance benchmark for NodeJS
14
14
  - [Features](#features)
15
15
  - [Installing](#installing)
16
16
  - [Examples](#examples)
17
+ - [Showcase](#showcase)
17
18
  - [License](#license)
18
19
 
19
20
  ## Features
@@ -125,6 +126,15 @@ npx overtake -i "class A{}" -i "function A() {}" -i "A = () => {};" -c 20000
125
126
 
126
127
  Please take a look at [benchmarks](__benchmarks__) to see more examples
127
128
 
129
+ ## Showcase
130
+
131
+ Already measured performance
132
+
133
+ - [Class vs Function](./overtakes/class-vs-function.md)
134
+ - [Postgres vs MongoDB](./overtakes/postgres-vs-mongo.md)
135
+ - [Array Copy](./overtakes/array-copy.md)
136
+ - [Array Delete Element](./overtakes/array-delete-element.md)
137
+
128
138
  ## License
129
139
 
130
140
  License [Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0)
@@ -0,0 +1,80 @@
1
+ # Array copy methods
2
+
3
+ ```
4
+ ⭐ Script __benchmarks__/array-copy.js
5
+ ⇶ Suite Array copy methods
6
+ ➤ Perform 10 elements
7
+ ✓ Measure 500000 slice
8
+ ┌──────────┬──────────┬──────────┬──────────┬───────────┬────────┐
9
+ │ (index) │ med │ p95 │ p99 │ total │ count │
10
+ ├──────────┼──────────┼──────────┼──────────┼───────────┼────────┤
11
+ │ 0.000059 │ 0.000065 │ 0.000105 │ 0.000241 │ 50.160222 │ 500000 │
12
+ └──────────┴──────────┴──────────┴──────────┴───────────┴────────┘
13
+ ✓ Measure 500000 spread
14
+ ┌──────────┬──────────┬──────────┬──────────┬──────────┬────────┐
15
+ │ (index) │ med │ p95 │ p99 │ total │ count │
16
+ ├──────────┼──────────┼──────────┼──────────┼──────────┼────────┤
17
+ │ 0.000061 │ 0.000067 │ 0.000087 │ 0.000193 │ 44.70032 │ 500000 │
18
+ └──────────┴──────────┴──────────┴──────────┴──────────┴────────┘
19
+ ✓ Measure 500000 concat
20
+ ┌──────────┬──────────┬──────────┬──────────┬───────────┬────────┐
21
+ │ (index) │ med │ p95 │ p99 │ total │ count │
22
+ ├──────────┼──────────┼──────────┼──────────┼───────────┼────────┤
23
+ │ 0.000061 │ 0.000068 │ 0.000119 │ 0.000234 │ 40.695219 │ 500000 │
24
+ └──────────┴──────────┴──────────┴──────────┴───────────┴────────┘
25
+ ✓ Measure 500000 Array.from
26
+ ┌──────────┬──────────┬──────────┬──────────┬───────────┬────────┐
27
+ │ (index) │ med │ p95 │ p99 │ total │ count │
28
+ ├──────────┼──────────┼──────────┼──────────┼───────────┼────────┤
29
+ │ 0.000065 │ 0.000072 │ 0.000126 │ 0.000237 │ 50.390629 │ 500000 │
30
+ └──────────┴──────────┴──────────┴──────────┴───────────┴────────┘
31
+ ✓ Measure 500000 for loop assign
32
+ ┌──────────┬──────────┬──────────┬──────────┬───────────┬────────┐
33
+ │ (index) │ med │ p95 │ p99 │ total │ count │
34
+ ├──────────┼──────────┼──────────┼──────────┼───────────┼────────┤
35
+ │ 0.000066 │ 0.000071 │ 0.000126 │ 0.000287 │ 43.803009 │ 500000 │
36
+ └──────────┴──────────┴──────────┴──────────┴───────────┴────────┘
37
+ ✓ Measure 500000 for loop push
38
+ ┌──────────┬──────────┬──────────┬──────────┬───────────┬────────┐
39
+ │ (index) │ med │ p95 │ p99 │ total │ count │
40
+ ├──────────┼──────────┼──────────┼──────────┼───────────┼────────┤
41
+ │ 0.000065 │ 0.000072 │ 0.000142 │ 0.000284 │ 43.769935 │ 500000 │
42
+ └──────────┴──────────┴──────────┴──────────┴───────────┴────────┘
43
+ ➤ Perform 1000 elements
44
+ ✓ Measure 500000 slice
45
+ ┌─────────┬──────────┬──────────┬──────────┬────────────┬────────┐
46
+ │ (index) │ med │ p95 │ p99 │ total │ count │
47
+ ├─────────┼──────────┼──────────┼──────────┼────────────┼────────┤
48
+ │ 0.00011 │ 0.000182 │ 0.000371 │ 0.000601 │ 186.871627 │ 500000 │
49
+ └─────────┴──────────┴──────────┴──────────┴────────────┴────────┘
50
+ ✓ Measure 500000 spread
51
+ ┌──────────┬──────────┬──────────┬──────────┬────────────┬────────┐
52
+ │ (index) │ med │ p95 │ p99 │ total │ count │
53
+ ├──────────┼──────────┼──────────┼──────────┼────────────┼────────┤
54
+ │ 0.000113 │ 0.000186 │ 0.000362 │ 0.000577 │ 186.106348 │ 500000 │
55
+ └──────────┴──────────┴──────────┴──────────┴────────────┴────────┘
56
+ ✓ Measure 500000 concat
57
+ ┌──────────┬──────────┬──────────┬──────────┬────────────┬────────┐
58
+ │ (index) │ med │ p95 │ p99 │ total │ count │
59
+ ├──────────┼──────────┼──────────┼──────────┼────────────┼────────┤
60
+ │ 0.000116 │ 0.000199 │ 0.000445 │ 0.000772 │ 204.249913 │ 500000 │
61
+ └──────────┴──────────┴──────────┴──────────┴────────────┴────────┘
62
+ ✓ Measure 500000 Array.from
63
+ ┌──────────┬─────────┬──────────┬──────────┬────────────┬────────┐
64
+ │ (index) │ med │ p95 │ p99 │ total │ count │
65
+ ├──────────┼─────────┼──────────┼──────────┼────────────┼────────┤
66
+ │ 0.000113 │ 0.00019 │ 0.000347 │ 0.000564 │ 190.512575 │ 500000 │
67
+ └──────────┴─────────┴──────────┴──────────┴────────────┴────────┘
68
+ ✓ Measure 500000 for loop assign
69
+ ┌──────────┬──────────┬──────────┬─────────┬────────────┬────────┐
70
+ │ (index) │ med │ p95 │ p99 │ total │ count │
71
+ ├──────────┼──────────┼──────────┼─────────┼────────────┼────────┤
72
+ │ 0.002016 │ 0.002428 │ 0.003344 │ 0.00437 │ 1477.99805 │ 500000 │
73
+ └──────────┴──────────┴──────────┴─────────┴────────────┴────────┘
74
+ ✓ Measure 500000 for loop push
75
+ ┌──────────┬──────────┬──────────┬──────────┬─────────────┬────────┐
76
+ │ (index) │ med │ p95 │ p99 │ total │ count │
77
+ ├──────────┼──────────┼──────────┼──────────┼─────────────┼────────┤
78
+ │ 0.002343 │ 0.002756 │ 0.003774 │ 0.006158 │ 1687.568837 │ 500000 │
79
+ └──────────┴──────────┴──────────┴──────────┴─────────────┴────────┘
80
+ ```
@@ -0,0 +1,44 @@
1
+ # Array delete element
2
+
3
+ ```
4
+ ⭐ Script __benchmarks__/array-delete-element.js
5
+ ⇶ Suite Array delete element methods
6
+ ➤ Perform 10 elements
7
+ ✓ Measure 500000 splice
8
+ ┌──────────┬──────────┬──────────┬──────────┬───────────┬────────┐
9
+ │ (index) │ med │ p95 │ p99 │ total │ count │
10
+ ├──────────┼──────────┼──────────┼──────────┼───────────┼────────┤
11
+ │ 0.000072 │ 0.000078 │ 0.000121 │ 0.000248 │ 57.628642 │ 500000 │
12
+ └──────────┴──────────┴──────────┴──────────┴───────────┴────────┘
13
+ ✓ Measure 500000 filter
14
+ ┌──────────┬──────────┬─────────┬──────────┬───────────┬────────┐
15
+ │ (index) │ med │ p95 │ p99 │ total │ count │
16
+ ├──────────┼──────────┼─────────┼──────────┼───────────┼────────┤
17
+ │ 0.000067 │ 0.000077 │ 0.00018 │ 0.000303 │ 51.695539 │ 500000 │
18
+ └──────────┴──────────┴─────────┴──────────┴───────────┴────────┘
19
+ ✓ Measure 500000 for loop
20
+ ┌──────────┬──────────┬──────────┬──────────┬───────────┬────────┐
21
+ │ (index) │ med │ p95 │ p99 │ total │ count │
22
+ ├──────────┼──────────┼──────────┼──────────┼───────────┼────────┤
23
+ │ 0.000064 │ 0.000074 │ 0.000119 │ 0.000307 │ 44.446428 │ 500000 │
24
+ └──────────┴──────────┴──────────┴──────────┴───────────┴────────┘
25
+ ➤ Perform 1000 elements
26
+ ✓ Measure 500000 splice
27
+ ┌─────────┬──────────┬──────────┬──────────┬───────────┬────────┐
28
+ │ (index) │ med │ p95 │ p99 │ total │ count │
29
+ ├─────────┼──────────┼──────────┼──────────┼───────────┼────────┤
30
+ │ 0.00007 │ 0.000076 │ 0.000121 │ 0.000268 │ 54.328497 │ 500000 │
31
+ └─────────┴──────────┴──────────┴──────────┴───────────┴────────┘
32
+ ✓ Measure 500000 filter
33
+ ┌──────────┬──────────┬──────────┬─────────┬────────────┬────────┐
34
+ │ (index) │ med │ p95 │ p99 │ total │ count │
35
+ ├──────────┼──────────┼──────────┼─────────┼────────────┼────────┤
36
+ │ 0.002064 │ 0.002521 │ 0.003448 │ 0.00804 │ 1571.98239 │ 500000 │
37
+ └──────────┴──────────┴──────────┴─────────┴────────────┴────────┘
38
+ ✓ Measure 500000 for loop
39
+ ┌──────────┬──────────┬──────────┬─────────┬─────────────┬────────┐
40
+ │ (index) │ med │ p95 │ p99 │ total │ count │
41
+ ├──────────┼──────────┼──────────┼─────────┼─────────────┼────────┤
42
+ │ 0.002166 │ 0.002625 │ 0.003383 │ 0.00448 │ 1578.507514 │ 500000 │
43
+ └──────────┴──────────┴──────────┴─────────┴─────────────┴────────┘
44
+ ```
@@ -0,0 +1,31 @@
1
+ # Class vs Function
2
+
3
+ ```
4
+ ⭐ Script __benchmarks__/class-vs-function.js
5
+ ⇶ Suite Class vs Function
6
+ ➤ Perform Instantiation
7
+ ✓ Measure 1000000 class declarations via "class"
8
+ ┌──────────┬──────────┬──────────┬──────────┬───────────┬─────────┐
9
+ │ (index) │ med │ p95 │ p99 │ total │ count │
10
+ ├──────────┼──────────┼──────────┼──────────┼───────────┼─────────┤
11
+ │ 0.000438 │ 0.000496 │ 0.001133 │ 0.001602 │ 684.87052 │ 1000000 │
12
+ └──────────┴──────────┴──────────┴──────────┴───────────┴─────────┘
13
+ ✓ Measure 1000000 instantiations of the declared class via class and test method call
14
+ ┌──────────┬──────────┬──────────┬──────────┬───────────┬─────────┐
15
+ │ (index) │ med │ p95 │ p99 │ total │ count │
16
+ ├──────────┼──────────┼──────────┼──────────┼───────────┼─────────┤
17
+ │ 0.000048 │ 0.000054 │ 0.000059 │ 0.000137 │ 61.055298 │ 1000000 │
18
+ └──────────┴──────────┴──────────┴──────────┴───────────┴─────────┘
19
+ ✓ Measure 1000000 class declarations via function
20
+ ┌─────────┬──────────┬─────────┬──────────┬──────────┬─────────┐
21
+ │ (index) │ med │ p95 │ p99 │ total │ count │
22
+ ├─────────┼──────────┼─────────┼──────────┼──────────┼─────────┤
23
+ │ 0.00005 │ 0.000056 │ 0.00007 │ 0.000146 │ 63.94922 │ 1000000 │
24
+ └─────────┴──────────┴─────────┴──────────┴──────────┴─────────┘
25
+ ✓ Measure 1000000 instantiations of the declared class via function and test method call
26
+ ┌──────────┬──────────┬─────────┬──────────┬───────────┬─────────┐
27
+ │ (index) │ med │ p95 │ p99 │ total │ count │
28
+ ├──────────┼──────────┼─────────┼──────────┼───────────┼─────────┤
29
+ │ 0.000049 │ 0.000056 │ 0.00008 │ 0.000189 │ 78.511849 │ 1000000 │
30
+ └──────────┴──────────┴─────────┴──────────┴───────────┴─────────┘
31
+ ```
@@ -0,0 +1,55 @@
1
+ ### Postgres vs MongoDB
2
+
3
+ ```
4
+ ⭐ Script __benchmarks__/postgres-vs-mongo.js
5
+ ⇶ Suite mongodb vs postgres
6
+ ➤ Perform simple test
7
+ ✓ Measure 1000 postgres inserts
8
+ ┌──────────┬──────────┬──────────┬─────────┬─────────────┬───────┐
9
+ │ (index) │ med │ p95 │ p99 │ total │ count │
10
+ ├──────────┼──────────┼──────────┼─────────┼─────────────┼───────┤
11
+ │ 2.232527 │ 2.256009 │ 2.917856 │ 5.41444 │ 2408.708534 │ 1000 │
12
+ └──────────┴──────────┴──────────┴─────────┴─────────────┴───────┘
13
+ ✓ Measure 1000 mongodb inserts
14
+ ┌──────────┬──────────┬──────────┬──────────┬─────────────┬───────┐
15
+ │ (index) │ med │ p95 │ p99 │ total │ count │
16
+ ├──────────┼──────────┼──────────┼──────────┼─────────────┼───────┤
17
+ │ 2.955035 │ 2.981828 │ 5.038826 │ 5.467477 │ 3233.680552 │ 1000 │
18
+ └──────────┴──────────┴──────────┴──────────┴─────────────┴───────┘
19
+ ✓ Measure 1000 postgres query data
20
+ ┌─────────┬──────────┬──────────┬──────────┬────────────┬───────┐
21
+ │ (index) │ med │ p95 │ p99 │ total │ count │
22
+ ├─────────┼──────────┼──────────┼──────────┼────────────┼───────┤
23
+ │ 0.28218 │ 0.297544 │ 0.393615 │ 0.561729 │ 308.713494 │ 1000 │
24
+ └─────────┴──────────┴──────────┴──────────┴────────────┴───────┘
25
+ ✓ Measure 1000 mongodb query data
26
+ ┌──────────┬──────────┬──────────┬──────────┬───────────┬───────┐
27
+ │ (index) │ med │ p95 │ p99 │ total │ count │
28
+ ├──────────┼──────────┼──────────┼──────────┼───────────┼───────┤
29
+ │ 0.457289 │ 0.461665 │ 0.693627 │ 0.919116 │ 495.27099 │ 1000 │
30
+ └──────────┴──────────┴──────────┴──────────┴───────────┴───────┘
31
+ ✓ Measure 1000 postgres query inserts
32
+ ┌──────────┬──────────┬──────────┬──────────┬─────────────┬───────┐
33
+ │ (index) │ med │ p95 │ p99 │ total │ count │
34
+ ├──────────┼──────────┼──────────┼──────────┼─────────────┼───────┤
35
+ │ 2.491574 │ 2.500577 │ 3.524734 │ 6.177946 │ 2681.101875 │ 1000 │
36
+ └──────────┴──────────┴──────────┴──────────┴─────────────┴───────┘
37
+ ✓ Measure 1000 mongodb query inserts
38
+ ┌──────────┬──────────┬──────────┬─────────┬─────────────┬───────┐
39
+ │ (index) │ med │ p95 │ p99 │ total │ count │
40
+ ├──────────┼──────────┼──────────┼─────────┼─────────────┼───────┤
41
+ │ 3.946823 │ 3.921073 │ 5.969672 │ 6.26903 │ 3954.008642 │ 1000 │
42
+ └──────────┴──────────┴──────────┴─────────┴─────────────┴───────┘
43
+ ✓ Measure 1000 postgres group data
44
+ ┌──────────┬──────────┬──────────┬──────────┬────────────┬───────┐
45
+ │ (index) │ med │ p95 │ p99 │ total │ count │
46
+ ├──────────┼──────────┼──────────┼──────────┼────────────┼───────┤
47
+ │ 0.287954 │ 0.272375 │ 0.347489 │ 0.494122 │ 279.076014 │ 1000 │
48
+ └──────────┴──────────┴──────────┴──────────┴────────────┴───────┘
49
+ ✓ Measure 1000 mongodb group data
50
+ ┌──────────┬──────────┬──────────┬──────────┬────────────┬───────┐
51
+ │ (index) │ med │ p95 │ p99 │ total │ count │
52
+ ├──────────┼──────────┼──────────┼──────────┼────────────┼───────┤
53
+ │ 0.564809 │ 0.556707 │ 0.666702 │ 0.851308 │ 569.134585 │ 1000 │
54
+ └──────────┴──────────┴──────────┴──────────┴────────────┴───────┘
55
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "overtake",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "description": "NodeJS performance benchmark",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -34,6 +34,8 @@
34
34
  "@types/jest": "^29.5.0",
35
35
  "husky": "^8.0.3",
36
36
  "jest": "^29.5.0",
37
+ "mongodb": "^5.1.0",
38
+ "pg": "^8.10.0",
37
39
  "prettier": "^2.8.4",
38
40
  "pretty-quick": "^3.1.3"
39
41
  },