Skip to content

Commit 9410f7d

Browse files
committed
docs(benchmark): update benchmark
1 parent 93159a8 commit 9410f7d

File tree

8 files changed

+48
-48
lines changed

8 files changed

+48
-48
lines changed

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -109,34 +109,34 @@ Mutative is up to 6x faster than naive handcrafted reducer for updating immutabl
109109

110110
> Mutative passed all of Immer's test cases.
111111
112-
Measure(ops/sec) to update 50K arrays and 1K objects, bigger is better([view source](https://github.com/unadlib/mutative/blob/main/test/performance/benchmark.ts)). [Mutative v1.0.11 vs Immer v10.1.1]
112+
Measure(ops/sec) to update 50K arrays and 1K objects, bigger is better([view source](https://github.com/unadlib/mutative/blob/main/test/performance/benchmark.ts)). [Mutative v1.1.0 vs Immer v10.1.1]
113113

114114
![Benchmark](benchmark.jpg)
115115

116116
```
117-
Naive handcrafted reducer - No Freeze x 4,469 ops/sec ±0.82% (99 runs sampled)
118-
Mutative - No Freeze x 6,015 ops/sec ±1.17% (94 runs sampled)
119-
Immer - No Freeze x 5.36 ops/sec ±0.28% (18 runs sampled)
117+
Naive handcrafted reducer - No Freeze x 4,670 ops/sec ±0.64% (96 runs sampled)
118+
Mutative - No Freeze x 6,747 ops/sec ±0.61% (95 runs sampled)
119+
Immer - No Freeze x 5.65 ops/sec ±1.53% (19 runs sampled)
120120
121-
Mutative - Freeze x 959 ops/sec ±0.90% (99 runs sampled)
122-
Immer - Freeze x 382 ops/sec ±0.53% (94 runs sampled)
121+
Mutative - Freeze x 1,062 ops/sec ±0.74% (95 runs sampled)
122+
Immer - Freeze x 394 ops/sec ±0.85% (93 runs sampled)
123123
124-
Mutative - Patches and No Freeze x 970 ops/sec ±0.99% (96 runs sampled)
125-
Immer - Patches and No Freeze x 5.22 ops/sec ±0.80% (18 runs sampled)
124+
Mutative - Patches and No Freeze x 1,011 ops/sec ±0.24% (98 runs sampled)
125+
Immer - Patches and No Freeze x 5.64 ops/sec ±0.22% (19 runs sampled)
126126
127-
Mutative - Patches and Freeze x 505 ops/sec ±0.85% (93 runs sampled)
128-
Immer - Patches and Freeze x 275 ops/sec ±0.49% (89 runs sampled)
127+
Mutative - Patches and Freeze x 545 ops/sec ±1.19% (94 runs sampled)
128+
Immer - Patches and Freeze x 215 ops/sec ±0.70% (86 runs sampled)
129129
130130
The fastest method is Mutative - No Freeze
131131
```
132132

133133
Run `yarn benchmark` to measure performance.
134134

135-
> OS: macOS 14.6.1, CPU: Apple M1 Max, Node.js: v20.11.0
135+
> OS: macOS 14.7, CPU: Apple M1 Max, Node.js: v22.11.0
136136
137137
Immer relies on auto-freeze to be enabled, if auto-freeze is disabled, Immer will have a huge performance drop and Mutative will have a huge performance lead, especially with large data structures it will have a performance lead of more than 50x.
138138

139-
So if you are using Immer, you will have to enable auto-freeze for performance. Mutative is disabled auto-freeze by default. With the default configuration of both, we can see the 16x performance gap between Mutative (`6,015 ops/sec`) and Immer (`382 ops/sec`).
139+
So if you are using Immer, you will have to enable auto-freeze for performance. Mutative is disabled auto-freeze by default. With the default configuration of both, we can see the 17x performance gap between Mutative (`6,747 ops/sec`) and Immer (`394 ops/sec`).
140140

141141
Overall, Mutative has a huge performance lead over Immer in [more performance testing scenarios](https://github.com/unadlib/mutative/tree/main/test/performance). Run `yarn performance` to get all the performance results locally.
142142

benchmark.jpg

-26 Bytes
Loading
-26 Bytes
Loading

website/blog/releases/1.0/index.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -94,34 +94,34 @@ const state = create(baseState, (draft) => {
9494

9595
> Mutative passed all of Immer's test cases.
9696
97-
Measure(ops/sec) to update 50K arrays and 1K objects, bigger is better([view source](https://github.com/unadlib/mutative/blob/main/test/performance/benchmark.ts)). [Mutative v1.0.11 vs Immer v10.1.1]
97+
Measure(ops/sec) to update 50K arrays and 1K objects, bigger is better([view source](https://github.com/unadlib/mutative/blob/main/test/performance/benchmark.ts)). [Mutative v1.1.0 vs Immer v10.1.1]
9898

9999
![Benchmark](img/benchmark.jpg)
100100

101101
```
102-
Naive handcrafted reducer - No Freeze x 4,469 ops/sec ±0.82% (99 runs sampled)
103-
Mutative - No Freeze x 6,015 ops/sec ±1.17% (94 runs sampled)
104-
Immer - No Freeze x 5.36 ops/sec ±0.28% (18 runs sampled)
102+
Naive handcrafted reducer - No Freeze x 4,670 ops/sec ±0.64% (96 runs sampled)
103+
Mutative - No Freeze x 6,747 ops/sec ±0.61% (95 runs sampled)
104+
Immer - No Freeze x 5.65 ops/sec ±1.53% (19 runs sampled)
105105
106-
Mutative - Freeze x 959 ops/sec ±0.90% (99 runs sampled)
107-
Immer - Freeze x 382 ops/sec ±0.53% (94 runs sampled)
106+
Mutative - Freeze x 1,062 ops/sec ±0.74% (95 runs sampled)
107+
Immer - Freeze x 394 ops/sec ±0.85% (93 runs sampled)
108108
109-
Mutative - Patches and No Freeze x 970 ops/sec ±0.99% (96 runs sampled)
110-
Immer - Patches and No Freeze x 5.22 ops/sec ±0.80% (18 runs sampled)
109+
Mutative - Patches and No Freeze x 1,011 ops/sec ±0.24% (98 runs sampled)
110+
Immer - Patches and No Freeze x 5.64 ops/sec ±0.22% (19 runs sampled)
111111
112-
Mutative - Patches and Freeze x 505 ops/sec ±0.85% (93 runs sampled)
113-
Immer - Patches and Freeze x 275 ops/sec ±0.49% (89 runs sampled)
112+
Mutative - Patches and Freeze x 545 ops/sec ±1.19% (94 runs sampled)
113+
Immer - Patches and Freeze x 215 ops/sec ±0.70% (86 runs sampled)
114114
115115
The fastest method is Mutative - No Freeze
116116
```
117117

118118
Run `yarn benchmark` to measure performance.
119119

120-
> OS: macOS 14.6.1, CPU: Apple M1 Max, Node.js: v20.11.0
120+
> OS: macOS 14.7, CPU: Apple M1 Max, Node.js: v22.11.0
121121
122122
Immer relies on auto-freeze to be enabled, if auto-freeze is disabled, Immer will have a huge performance drop and Mutative will have a huge performance lead, especially with large data structures it will have a performance lead of more than 50x.
123123

124-
So if you are using Immer, you will have to enable auto-freeze for performance. Mutative is disabled auto-freeze by default. With the default configuration of both, we can see the 16x performance gap between Mutative (`6,015 ops/sec`) and Immer (`382 ops/sec`).
124+
So if you are using Immer, you will have to enable auto-freeze for performance. Mutative is disabled auto-freeze by default. With the default configuration of both, we can see the 17x performance gap between Mutative (`6,747 ops/sec`) and Immer (`394 ops/sec`).
125125

126126
Overall, Mutative has a huge performance lead over Immer in [more performance testing scenarios](https://github.com/unadlib/mutative/tree/main/test/performance).
127127

website/docs/extra-topics/comparison-with-immer.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,33 +26,33 @@ Mutative has fewer bugs such as accidental draft escapes than Immer, [view detai
2626

2727
> Mutative passed all of Immer's test cases.
2828
29-
Measure(ops/sec) to update 50K arrays and 1K objects, bigger is better([view source](https://github.com/unadlib/mutative/blob/main/test/performance/benchmark.ts)). [Mutative v1.0.11 vs Immer v10.1.1]
29+
Measure(ops/sec) to update 50K arrays and 1K objects, bigger is better([view source](https://github.com/unadlib/mutative/blob/main/test/performance/benchmark.ts)). [Mutative v1.1.0 vs Immer v10.1.1]
3030

3131
![Benchmark](img/benchmark.jpg)
3232

3333
```
34-
Naive handcrafted reducer - No Freeze x 4,469 ops/sec ±0.82% (99 runs sampled)
35-
Mutative - No Freeze x 6,015 ops/sec ±1.17% (94 runs sampled)
36-
Immer - No Freeze x 5.36 ops/sec ±0.28% (18 runs sampled)
34+
Naive handcrafted reducer - No Freeze x 4,670 ops/sec ±0.64% (96 runs sampled)
35+
Mutative - No Freeze x 6,747 ops/sec ±0.61% (95 runs sampled)
36+
Immer - No Freeze x 5.65 ops/sec ±1.53% (19 runs sampled)
3737
38-
Mutative - Freeze x 959 ops/sec ±0.90% (99 runs sampled)
39-
Immer - Freeze x 382 ops/sec ±0.53% (94 runs sampled)
38+
Mutative - Freeze x 1,062 ops/sec ±0.74% (95 runs sampled)
39+
Immer - Freeze x 394 ops/sec ±0.85% (93 runs sampled)
4040
41-
Mutative - Patches and No Freeze x 970 ops/sec ±0.99% (96 runs sampled)
42-
Immer - Patches and No Freeze x 5.22 ops/sec ±0.80% (18 runs sampled)
41+
Mutative - Patches and No Freeze x 1,011 ops/sec ±0.24% (98 runs sampled)
42+
Immer - Patches and No Freeze x 5.64 ops/sec ±0.22% (19 runs sampled)
4343
44-
Mutative - Patches and Freeze x 505 ops/sec ±0.85% (93 runs sampled)
45-
Immer - Patches and Freeze x 275 ops/sec ±0.49% (89 runs sampled)
44+
Mutative - Patches and Freeze x 545 ops/sec ±1.19% (94 runs sampled)
45+
Immer - Patches and Freeze x 215 ops/sec ±0.70% (86 runs sampled)
4646
4747
The fastest method is Mutative - No Freeze
4848
```
4949

5050
Run `yarn benchmark` to measure performance.
5151

52-
> OS: macOS 14.6.1, CPU: Apple M1 Max, Node.js: v20.11.0
52+
> OS: macOS 14.7, CPU: Apple M1 Max, Node.js: v22.11.0
5353
5454
Immer relies on auto-freeze to be enabled, if auto-freeze is disabled, Immer will have a huge performance drop and Mutative will have a huge performance lead, especially with large data structures it will have a performance lead of more than 50x.
5555

56-
So if you are using Immer, you will have to enable auto-freeze for performance. Mutative is disabled auto-freeze by default. With the default configuration of both, we can see the 16x performance gap between Mutative (`6,015 ops/sec`) and Immer (`382 ops/sec`).
56+
So if you are using Immer, you will have to enable auto-freeze for performance. Mutative is disabled auto-freeze by default. With the default configuration of both, we can see the 17x performance gap between Mutative (`6,747 ops/sec`) and Immer (`394 ops/sec`).
5757

5858
Overall, Mutative has a huge performance lead over Immer in [more performance testing scenarios](https://github.com/unadlib/mutative/tree/main/test/performance). Run `yarn performance` to get all the performance results locally.
-26 Bytes
Loading
-26 Bytes
Loading

website/docs/getting-started/performance.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -82,34 +82,34 @@ const state = create(baseState, (draft) => {
8282

8383
> Mutative passed all of Immer's test cases.
8484
85-
Measure(ops/sec) to update 50K arrays and 1K objects, bigger is better([view source](https://github.com/unadlib/mutative/blob/main/test/performance/benchmark.ts)). [Mutative v1.0.11 vs Immer v10.1.1]
85+
Measure(ops/sec) to update 50K arrays and 1K objects, bigger is better([view source](https://github.com/unadlib/mutative/blob/main/test/performance/benchmark.ts)). [Mutative v1.1.0 vs Immer v10.1.1]
8686

8787
![Benchmark](img/benchmark.jpg)
8888

8989
```
90-
Naive handcrafted reducer - No Freeze x 4,469 ops/sec ±0.82% (99 runs sampled)
91-
Mutative - No Freeze x 6,015 ops/sec ±1.17% (94 runs sampled)
92-
Immer - No Freeze x 5.36 ops/sec ±0.28% (18 runs sampled)
90+
Naive handcrafted reducer - No Freeze x 4,670 ops/sec ±0.64% (96 runs sampled)
91+
Mutative - No Freeze x 6,747 ops/sec ±0.61% (95 runs sampled)
92+
Immer - No Freeze x 5.65 ops/sec ±1.53% (19 runs sampled)
9393
94-
Mutative - Freeze x 959 ops/sec ±0.90% (99 runs sampled)
95-
Immer - Freeze x 382 ops/sec ±0.53% (94 runs sampled)
94+
Mutative - Freeze x 1,062 ops/sec ±0.74% (95 runs sampled)
95+
Immer - Freeze x 394 ops/sec ±0.85% (93 runs sampled)
9696
97-
Mutative - Patches and No Freeze x 970 ops/sec ±0.99% (96 runs sampled)
98-
Immer - Patches and No Freeze x 5.22 ops/sec ±0.80% (18 runs sampled)
97+
Mutative - Patches and No Freeze x 1,011 ops/sec ±0.24% (98 runs sampled)
98+
Immer - Patches and No Freeze x 5.64 ops/sec ±0.22% (19 runs sampled)
9999
100-
Mutative - Patches and Freeze x 505 ops/sec ±0.85% (93 runs sampled)
101-
Immer - Patches and Freeze x 275 ops/sec ±0.49% (89 runs sampled)
100+
Mutative - Patches and Freeze x 545 ops/sec ±1.19% (94 runs sampled)
101+
Immer - Patches and Freeze x 215 ops/sec ±0.70% (86 runs sampled)
102102
103103
The fastest method is Mutative - No Freeze
104104
```
105105

106106
Run `yarn benchmark` to measure performance.
107107

108-
> OS: macOS 14.6.1, CPU: Apple M1 Max, Node.js: v20.11.0
108+
> OS: macOS 14.7, CPU: Apple M1 Max, Node.js: v22.11.0
109109
110110
Immer relies on auto-freeze to be enabled, if auto-freeze is disabled, Immer will have a huge performance drop and Mutative will have a huge performance lead, especially with large data structures it will have a performance lead of more than 50x.
111111

112-
So if you are using Immer, you will have to enable auto-freeze for performance. Mutative is disabled auto-freeze by default. With the default configuration of both, we can see the 16x performance gap between Mutative (`6,015 ops/sec`) and Immer (`382 ops/sec`).
112+
So if you are using Immer, you will have to enable auto-freeze for performance. Mutative is disabled auto-freeze by default. With the default configuration of both, we can see the 17x performance gap between Mutative (`6,747 ops/sec`) and Immer (`394 ops/sec`).
113113

114114
Overall, Mutative has a huge performance lead over Immer in [more performance testing scenarios](https://github.com/unadlib/mutative/tree/main/test/performance). Run `yarn performance` to get all the performance results locally.
115115

0 commit comments

Comments
 (0)