martyjs / marty

A Javascript library for state management in React applications
http://martyjs.org
MIT License
1.09k stars 76 forks source link

Performance Implications? #372

Open KeKs0r opened 9 years ago

KeKs0r commented 9 years ago

Hi,

I migrated my app from a simple Flux app to marty and react-router. After that migration and some refactoring I am experiencing a heavy performance loss. I am mainly concerned with page transitions that are especially on android phones very laggy. Almost unbearable.

I have already tried a lot to optimize, but the general thing is something I cant get my head around, since its almost the same app with same data / views etc, but now its just very laggy. I don't think that marty or something itself is slow, but maybe a heavy use of marty containers or something would make the app slow.

Has someone maybe some advice. I have already done all the normal react optimization and even with 2 days of work to optimize the rendering of a single view tree is not having a real impact compared to how the app worked out of the box before.

taion commented 9 years ago

As a general rule it's not a bad idea to limit the number of event emitters. Where does the profiler say time is going?

KeKs0r commented 9 years ago

I am puzzled by this a lot. One of the confusing thins is as simple as showing the wasted time in renders. Where I see that one component is rendered several times where it did not end up in changing the dom. And this component seems slightly expensive. The issue is, when debugging it the component is exactly rendered once and shouldComponentUpdate, is not called at all during the transaction I am tracking.

I even created an issue for it, but could not yet reproduce it in a simpler environment: https://github.com/facebook/react/issues/4462