cerebral-legacy / cerebral-website

Cerebral website
http://cerebral-website.herokuapp.com
8 stars 14 forks source link

Mention perfomance in Choosing a model #47

Closed maxfrigge closed 8 years ago

maxfrigge commented 8 years ago

Not even sure how big the performance gain is, but in theory the rendering performance should be better when using immutable model in combination with shouldComponentUpdate and shallow checking.

edgesoft commented 8 years ago

@maxfrigge The set or merge of large datasets is slower on immutable then mutable. shouldComponentUpdate always returns false with the new cerebral-view-react. So I don't think you need to do the checking.

maxfrigge commented 8 years ago

@edgesoft I agree that the performance of expensive state mutations will increase without immutable state, but afaik Cerebral will only be able to efficiently update the views that are directly connected to the state using connect all sub components are most likely being re rendered each time, whether their data changed or not.

edgesoft commented 8 years ago

+1

Guria commented 8 years ago

@maxfrigge @edgesoft mutable model now has "Improved performance on large datasets" point in doc. is it enough?

edgesoft commented 8 years ago

@Guria Yes!

maxfrigge commented 8 years ago

@Guria Should do it for now. There is also the other side where your view's performance could be optimised with immutable data, but I don't think that it the impact will be big enough to actually care :) .. and it seems that nobody really researched this further.