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
I've found that working with JS data structures in an immutable way has significantly improved application performance.
Oversimplified example:
// mutation operation
const list = []
list.push('foo')
// immutable operation
let list = []
list = list.concat('foo')
While it may seem counter-intuitive in terms of working with completely new objects/values, when operating inside of complex loops/algorithms it has made both understanding what's happening to the data far easier to comprehend, as well you avoid scenarios where mutations can be far reaching and difficult to trace.
My team has successfully adopted this approach with one of our production APIs, and found it quite significantly improved performance.
We then took it a step further and use @substack's deep-freeze module as a simple safe guard against mutations.
This is one example I have, I'll see about digging up some more and/or finding decent articles that help make this more than just anecdotal :) .
The text was updated successfully, but these errors were encountered:
I've found that working with JS data structures in an immutable way has significantly improved application performance.
Oversimplified example:
While it may seem counter-intuitive in terms of working with completely new objects/values, when operating inside of complex loops/algorithms it has made both understanding what's happening to the data far easier to comprehend, as well you avoid scenarios where mutations can be far reaching and difficult to trace.
My team has successfully adopted this approach with one of our production APIs, and found it quite significantly improved performance.
We then took it a step further and use @substack's deep-freeze module as a simple safe guard against mutations.
This is one example I have, I'll see about digging up some more and/or finding decent articles that help make this more than just anecdotal :) .
The text was updated successfully, but these errors were encountered: