Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React-Router Running Slow on Hybrid App #1000

Closed
danieloliveira079 opened this issue Jun 30, 2015 · 6 comments
Closed

React-Router Running Slow on Hybrid App #1000

danieloliveira079 opened this issue Jun 30, 2015 · 6 comments
Labels
external dependency Blocked by external dependency, we can’t do anything about it performance

Comments

@danieloliveira079
Copy link

Hi all,

I've created a project based on Docs project and after got rid of some stuff that I wont use I've compiled a hybrid app using phonegap. Basically I kept Left Nav menu and a few pages/components.

I got surprised after install on a Android Samsung S4 and realise that when selecting any link from the left nav it takes a couple of seconds to get the page rendered on the main container.

This does not happen on iPhone.

After some debugging I realise that the problem occurs after react-router triggers.

Using react-router on another app I can't face any problem.

Are there anybody looking into that?

@ftorre104
Copy link

I'm working on a large, isomorphic react application using react-router and fluxxor. We have the exact problem. The responsive site works fine on new/faster computers -- tested and works fast on iPhone 6, and MacBookPro. However it is noticeably slower on older devices. We've tested Android on Samsung Note 2 running Android 4.3 and older Windows computers.

We've profiled the timelines and it appears to be whenever our actions trigger changes, causing re-renders. Not necessarily a lot of DOM changes (pretty small changes actually), but apparently a lot of react JS (mounting and other lifecycle methods as well as diffing I assume).

We've been able to make some improvements by batching our actions to result in less 'emit change' events. But this seems to me to be an anti-pattern for react, where you should loosely be able to re-render.

I'm thinking its a brute CPU power problem; its just to much JS.... (hoping it is not that, that would be horrible). I hope others have more insights to this.

@shaurya947
Copy link
Contributor

Seems like this is (or perhaps was?) more of an issue with React / react router..

@oliviertassinari any thoughts?

@oliviertassinari
Copy link
Member

First of all, the PhoneGap runtime is faster on iOS than on Android.
The rendering of the virtual dom of material-ui component is slow.
The first thing to do is to use immutable data and to resolve this #1176.
The second thing would be to reduce the CPU cycle needed to create the virtual dom.

@ftorre104
Copy link

That is good advice.
To follow up on my comment, we were able to get significant improvements by correctly using PureRenderMixin. (We thought we had it, but had previously implemented it incorrectly, and react was re-rendering every mounted component :/)
Now much faster on iOS and android. Still noticeably faster on iOS than android, albeit it is now much more usable.

@shaurya947
Copy link
Contributor

@ftorre104 feel free to close this issue if you want

@alitaheri alitaheri added performance external dependency Blocked by external dependency, we can’t do anything about it labels Dec 8, 2015
@newoga
Copy link
Contributor

newoga commented Mar 9, 2016

I'm going to close this for now. We also have another issue that relates to performance using Cordova #2036

@newoga newoga closed this as completed Mar 9, 2016
mnajdova pushed a commit to mnajdova/material-ui that referenced this issue Nov 10, 2020
* Use strict type for MaterialUIPickersDate

* Update to date-io 1.3.0

* [docs] Add installation note for typescript users

* Make proptypes search to sort the results by best match

* Fix date-io/core version

* Make custom typing of @date-io/type for docs

* Upgrade to @date-io 1.3.4

* Fix moment date-utils.test.tsx

* Remove installation step for importing @date-io/type module

* Add typescript changes to upgrading to v3 guide
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external dependency Blocked by external dependency, we can’t do anything about it performance
Projects
None yet
Development

No branches or pull requests

6 participants