DEV Community

Discussion on: Tight Code 1: When immutability goes bad

Collapse
 
louy2 profile image
Yufan Lou

I see. It is indeed a good thing to have one most post so people are more likely to stumble upon this information.

Thanks for the benchmark! I agree immutability is not free. Even Haskell uses internal states within high performing data structures.

Thread Thread
 
miketalbot profile image
Mike Talbot ⭐

Agreed, I mean my projects nearly 100% use some kind of immutability - my whole currently developed system is predicated on using transaction records and never mutating core data. I also love immer.js.

What I want to do in this series is just to point out - sometimes we should examine things in the tightest parts of our code if we are striving for 60fps. Oh yeah, and never do that stuff with [...blah, newThing] if there's a chance we will do it often! - That is just silly :)!!