{"repo":"unadlib/mutative","free":true,"listed":false,"github":"https://github.com/unadlib/mutative","clone":"git clone https://github.com/unadlib/mutative.git","description":"Efficient immutable updates, 2-6x faster than naive handcrafted reducer, and more than 10x faster than Immer.","language":"TypeScript","stars":1989,"topics":["immer","immutability","immutable","reducer","redux","mutable","mutation","state-management","mutative","react"],"license":"MIT","category":"ui-components","readme_excerpt":"Mutative Mutative - A JavaScript library for efficient immutable updates, 2-6x faster than naive handcrafted reducer, and more than 10x faster than Immer. Why is Mutative faster than the spread operation(naive handcrafted reducer)? The spread operation has performance pitfalls, which can be detailed in the following article: - The reduce ({...spread}) anti-pattern - How slow is the Spread operator in JavaScript? And Mutative optimization focus on shallow copy optimization, more complete lazy drafts, finalization process optimization, and more. Motivation Writing immutable updates by hand is usually difficult, prone to errors, and cumbersome. Immer helps us write simpler immutable updates with \"mutative\" logic. But its performance issue causes a runtime performance overhead. Immer must have auto-freeze enabled by default(Performance will be worse if auto-freeze is disabled), such immutable state with Immer is not common. In scenarios such as cross-processing, remote data transfer, etc., these immutable data must be constantly frozen. There are more parts that could be improved, such as better type inference, non-intrusive markup, support for more types of immutability, Safer immutability, more edge cases, and so on. This is why Mutative was created. Mutative vs Naive Handcrafted Reducer Performance Mutative vs Reducer benchmark by object: - Naive handcrafted reducer - Mutative Measure(seconds) to update the 1K-100K items object, lower is better(view source). Mutative is up to ","default_branch":null,"files":null,"tree":[],"storefront":"/r/unadlib","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/unadlib/mutative/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}