You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -110,23 +110,23 @@ Mutative is up to 6x faster than naive handcrafted reducer for updating immutabl
110
110
111
111
> Mutative passed all of Immer's test cases.
112
112
113
-
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.9 vs Immer v10.1.1]
113
+
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.10 vs Immer v10.1.1]
114
114
115
115

116
116
117
117
```
118
-
Naive handcrafted reducer - No Freeze x 4,447 ops/sec ±0.85% (96 runs sampled)
119
-
Mutative - No Freeze x 6,246 ops/sec ±1.29% (92 runs sampled)
120
-
Immer - No Freeze x 5.26 ops/sec ±0.56% (18 runs sampled)
118
+
Naive handcrafted reducer - No Freeze x 4,439 ops/sec ±0.65% (98 runs sampled)
119
+
Mutative - No Freeze x 6,300 ops/sec ±1.19% (94 runs sampled)
120
+
Immer - No Freeze x 5.26 ops/sec ±0.59% (18 runs sampled)
121
121
122
-
Mutative - Freeze x 950 ops/sec ±0.95% (96 runs sampled)
123
-
Immer - Freeze x 377 ops/sec ±0.37% (93 runs sampled)
122
+
Mutative - Freeze x 937 ops/sec ±1.25% (95 runs sampled)
123
+
Immer - Freeze x 378 ops/sec ±0.66% (93 runs sampled)
124
124
125
-
Mutative - Patches and No Freeze x 978 ops/sec ±0.16% (97 runs sampled)
126
-
Immer - Patches and No Freeze x 5.23 ops/sec ±0.25% (18 runs sampled)
125
+
Mutative - Patches and No Freeze x 975 ops/sec ±0.17% (99 runs sampled)
126
+
Immer - Patches and No Freeze x 5.29 ops/sec ±0.30% (18 runs sampled)
127
127
128
-
Mutative - Patches and Freeze x 504 ops/sec ±1.01% (94 runs sampled)
129
-
Immer - Patches and Freeze x 272 ops/sec ±0.83% (89 runs sampled)
128
+
Mutative - Patches and Freeze x 512 ops/sec ±0.85% (98 runs sampled)
129
+
Immer - Patches and Freeze x 278 ops/sec ±0.57% (90 runs sampled)
130
130
131
131
The fastest method is Mutative - No Freeze
132
132
```
@@ -137,7 +137,7 @@ Run `yarn benchmark` to measure performance.
137
137
138
138
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.
139
139
140
-
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,246 ops/sec`) and Immer (`377 ops/sec`).
140
+
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,300 ops/sec`) and Immer (`378 ops/sec`).
141
141
142
142
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.
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.9 vs Immer v10.1.1]
84
+
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.10 vs Immer v10.1.1]
85
85
86
86

87
87
88
88
```
89
-
Naive handcrafted reducer - No Freeze x 4,447 ops/sec ±0.85% (96 runs sampled)
90
-
Mutative - No Freeze x 6,246 ops/sec ±1.29% (92 runs sampled)
91
-
Immer - No Freeze x 5.26 ops/sec ±0.56% (18 runs sampled)
89
+
Naive handcrafted reducer - No Freeze x 4,439 ops/sec ±0.65% (98 runs sampled)
90
+
Mutative - No Freeze x 6,300 ops/sec ±1.19% (94 runs sampled)
91
+
Immer - No Freeze x 5.26 ops/sec ±0.59% (18 runs sampled)
92
92
93
-
Mutative - Freeze x 950 ops/sec ±0.95% (96 runs sampled)
94
-
Immer - Freeze x 377 ops/sec ±0.37% (93 runs sampled)
93
+
Mutative - Freeze x 937 ops/sec ±1.25% (95 runs sampled)
94
+
Immer - Freeze x 378 ops/sec ±0.66% (93 runs sampled)
95
95
96
-
Mutative - Patches and No Freeze x 978 ops/sec ±0.16% (97 runs sampled)
97
-
Immer - Patches and No Freeze x 5.23 ops/sec ±0.25% (18 runs sampled)
96
+
Mutative - Patches and No Freeze x 975 ops/sec ±0.17% (99 runs sampled)
97
+
Immer - Patches and No Freeze x 5.29 ops/sec ±0.30% (18 runs sampled)
98
98
99
-
Mutative - Patches and Freeze x 504 ops/sec ±1.01% (94 runs sampled)
100
-
Immer - Patches and Freeze x 272 ops/sec ±0.83% (89 runs sampled)
99
+
Mutative - Patches and Freeze x 512 ops/sec ±0.85% (98 runs sampled)
100
+
Immer - Patches and Freeze x 278 ops/sec ±0.57% (90 runs sampled)
101
101
102
102
The fastest method is Mutative - No Freeze
103
103
```
@@ -108,7 +108,7 @@ Run `yarn benchmark` to measure performance.
108
108
109
109
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.
110
110
111
-
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,246 ops/sec`) and Immer (`377 ops/sec`).
111
+
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,300 ops/sec`) and Immer (`378 ops/sec`).
112
112
113
113
Overall, Mutative has a huge performance lead over Immer in [more performance testing scenarios](https://github.com/unadlib/mutative/tree/main/test/performance).
Copy file name to clipboardExpand all lines: website/docs/extra-topics/comparison-with-immer.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,23 +25,23 @@ Mutative has fewer bugs such as accidental draft escapes than Immer, [view detai
25
25
26
26
> Mutative passed all of Immer's test cases.
27
27
28
-
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.9 vs Immer v10.1.1]
28
+
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.10 vs Immer v10.1.1]
29
29
30
30

31
31
32
32
```
33
-
Naive handcrafted reducer - No Freeze x 4,447 ops/sec ±0.85% (96 runs sampled)
34
-
Mutative - No Freeze x 6,246 ops/sec ±1.29% (92 runs sampled)
35
-
Immer - No Freeze x 5.26 ops/sec ±0.56% (18 runs sampled)
33
+
Naive handcrafted reducer - No Freeze x 4,439 ops/sec ±0.65% (98 runs sampled)
34
+
Mutative - No Freeze x 6,300 ops/sec ±1.19% (94 runs sampled)
35
+
Immer - No Freeze x 5.26 ops/sec ±0.59% (18 runs sampled)
36
36
37
-
Mutative - Freeze x 950 ops/sec ±0.95% (96 runs sampled)
38
-
Immer - Freeze x 377 ops/sec ±0.37% (93 runs sampled)
37
+
Mutative - Freeze x 937 ops/sec ±1.25% (95 runs sampled)
38
+
Immer - Freeze x 378 ops/sec ±0.66% (93 runs sampled)
39
39
40
-
Mutative - Patches and No Freeze x 978 ops/sec ±0.16% (97 runs sampled)
41
-
Immer - Patches and No Freeze x 5.23 ops/sec ±0.25% (18 runs sampled)
40
+
Mutative - Patches and No Freeze x 975 ops/sec ±0.17% (99 runs sampled)
41
+
Immer - Patches and No Freeze x 5.29 ops/sec ±0.30% (18 runs sampled)
42
42
43
-
Mutative - Patches and Freeze x 504 ops/sec ±1.01% (94 runs sampled)
44
-
Immer - Patches and Freeze x 272 ops/sec ±0.83% (89 runs sampled)
43
+
Mutative - Patches and Freeze x 512 ops/sec ±0.85% (98 runs sampled)
44
+
Immer - Patches and Freeze x 278 ops/sec ±0.57% (90 runs sampled)
45
45
46
46
The fastest method is Mutative - No Freeze
47
47
```
@@ -52,7 +52,7 @@ Run `yarn benchmark` to measure performance.
52
52
53
53
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.
54
54
55
-
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,246 ops/sec`) and Immer (`377 ops/sec`).
55
+
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,300 ops/sec`) and Immer (`378 ops/sec`).
56
56
57
57
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.
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.9 vs Immer v10.1.1]
72
+
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.10 vs Immer v10.1.1]
73
73
74
74

75
75
76
76
```
77
-
Naive handcrafted reducer - No Freeze x 4,447 ops/sec ±0.85% (96 runs sampled)
78
-
Mutative - No Freeze x 6,246 ops/sec ±1.29% (92 runs sampled)
79
-
Immer - No Freeze x 5.26 ops/sec ±0.56% (18 runs sampled)
77
+
Naive handcrafted reducer - No Freeze x 4,439 ops/sec ±0.65% (98 runs sampled)
78
+
Mutative - No Freeze x 6,300 ops/sec ±1.19% (94 runs sampled)
79
+
Immer - No Freeze x 5.26 ops/sec ±0.59% (18 runs sampled)
80
80
81
-
Mutative - Freeze x 950 ops/sec ±0.95% (96 runs sampled)
82
-
Immer - Freeze x 377 ops/sec ±0.37% (93 runs sampled)
81
+
Mutative - Freeze x 937 ops/sec ±1.25% (95 runs sampled)
82
+
Immer - Freeze x 378 ops/sec ±0.66% (93 runs sampled)
83
83
84
-
Mutative - Patches and No Freeze x 978 ops/sec ±0.16% (97 runs sampled)
85
-
Immer - Patches and No Freeze x 5.23 ops/sec ±0.25% (18 runs sampled)
84
+
Mutative - Patches and No Freeze x 975 ops/sec ±0.17% (99 runs sampled)
85
+
Immer - Patches and No Freeze x 5.29 ops/sec ±0.30% (18 runs sampled)
86
86
87
-
Mutative - Patches and Freeze x 504 ops/sec ±1.01% (94 runs sampled)
88
-
Immer - Patches and Freeze x 272 ops/sec ±0.83% (89 runs sampled)
87
+
Mutative - Patches and Freeze x 512 ops/sec ±0.85% (98 runs sampled)
88
+
Immer - Patches and Freeze x 278 ops/sec ±0.57% (90 runs sampled)
89
89
90
90
The fastest method is Mutative - No Freeze
91
91
```
@@ -96,7 +96,7 @@ Run `yarn benchmark` to measure performance.
96
96
97
97
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.
98
98
99
-
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,246 ops/sec`) and Immer (`377 ops/sec`).
99
+
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,300 ops/sec`) and Immer (`378 ops/sec`).
100
100
101
101
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.
0 commit comments