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
+19-10Lines changed: 19 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -108,23 +108,23 @@ Mutative is up to 6x faster than naive handcrafted reducer for updating immutabl
108
108
109
109
>Mutative passed all of Immer's test cases.
110
110
111
-
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.4 vs Immer v10.0.4]
111
+
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.5 vs Immer v10.0.4]
112
112
113
113

114
114
115
115
```
116
-
Naive handcrafted reducer - No Freeze x 4,450 ops/sec ±0.36% (96 runs sampled)
117
-
Mutative - No Freeze x 6,137 ops/sec ±1.15% (89 runs sampled)
118
-
Immer - No Freeze x 5.27 ops/sec ±0.65% (18 runs sampled)
116
+
Naive handcrafted reducer - No Freeze x 4,442 ops/sec ±0.49% (94 runs sampled)
117
+
Mutative - No Freeze x 6,101 ops/sec ±1.26% (88 runs sampled)
118
+
Immer - No Freeze x 5.20 ops/sec ±0.68% (17 runs sampled)
Immer - Patches and Freeze x272 ops/sec ±0.61% (88 runs sampled)
128
128
129
129
The fastest method is Mutative - No Freeze
130
130
```
@@ -139,6 +139,15 @@ So if you are using Immer, you will have to enable auto-freeze for performance.
139
139
140
140
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.
141
141
142
+
<details>
143
+
<summary><b>More Performance Testing Scenarios, Mutative is up to 2.5X-73.8X faster than Immer: </b></summary>
144
+
145
+

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.4 vs Immer v10.0.4]
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.5 vs Immer v10.0.4]
85
85
86
86

87
87
88
88
```
89
-
Naive handcrafted reducer - No Freeze x 4,450 ops/sec ±0.36% (96 runs sampled)
90
-
Mutative - No Freeze x 6,137 ops/sec ±1.15% (89 runs sampled)
91
-
Immer - No Freeze x 5.27 ops/sec ±0.65% (18 runs sampled)
89
+
Naive handcrafted reducer - No Freeze x 4,442 ops/sec ±0.49% (94 runs sampled)
90
+
Mutative - No Freeze x 6,101 ops/sec ±1.26% (88 runs sampled)
91
+
Immer - No Freeze x 5.20 ops/sec ±0.68% (17 runs sampled)
Copy file name to clipboardExpand all lines: website/docs/extra-topics/comparison-with-immer.md
+10-10Lines changed: 10 additions & 10 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.4 vs Immer v10.0.4]
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.5 vs Immer v10.0.4]
29
29
30
30

31
31
32
32
```
33
-
Naive handcrafted reducer - No Freeze x 4,450 ops/sec ±0.36% (96 runs sampled)
34
-
Mutative - No Freeze x 6,137 ops/sec ±1.15% (89 runs sampled)
35
-
Immer - No Freeze x 5.27 ops/sec ±0.65% (18 runs sampled)
33
+
Naive handcrafted reducer - No Freeze x 4,442 ops/sec ±0.49% (94 runs sampled)
34
+
Mutative - No Freeze x 6,101 ops/sec ±1.26% (88 runs sampled)
35
+
Immer - No Freeze x 5.20 ops/sec ±0.68% (17 runs sampled)