material-ui icon indicating copy to clipboard operation
material-ui copied to clipboard

Anyone tried Material-UI with Cordova? Is it slow?

Open felarof99 opened this issue 11 years ago • 15 comments

I created a simple ReactJS + Material-UI application with Tabs, Left Nav... Packaged it using Cordova and ran it on my Android phone. I was a bit disappointed because touch events (like changing to a different tab) lagged slightly and UI (ripples...) in general was not as responsive as using a simple Bootstrap Material Theme (like Bootswatch Paper - https://goo.gl/zw0W1I).

Does anyone feel the same? Or am I doing something wrong? (because I don't see any threads/complains on this)

PS:

  • My Android Phone is OnePlus One, so phone performance is not a problem.
  • I'm also not using fastclick (https://goo.gl/7oXFfT). Because I think the laggy-ness is not related to the famous 300ms delay with PhoneGap apps, my Android Chrome version is >32 and my viewport meta tag is as follows.

felarof99 avatar Nov 02 '15 12:11 felarof99

It's working decently well for me.

I'am using a crosswalk with cordova to get a more modern chrome.

MUI doesn't work correctly on all chrome.

are you compiling in release?

cgestes avatar Nov 02 '15 12:11 cgestes

You can have a look at https://play.google.com/store/apps/details?id=com.split.app. For me, it's not too bad.

oliviertassinari avatar Nov 02 '15 12:11 oliviertassinari

@cgestes I'm using reactify to transform JSX into JS.

@oliviertassinari I'm probably getting the same perf as your app. But I was expecting UX to be much smoother, like this app - https://play.google.com/store/apps/details?id=com.thinkmill.react_europe (its based on ReactJS but not using Material-UI)

felarof99 avatar Nov 02 '15 13:11 felarof99

I have super laggy performance on Cordova on Android. I too am using OnePlus One. I don't even have many components rendered. I just have a LeftNav, AppBar and a list with 25 items or so.

dpacmittal avatar Nov 26 '15 12:11 dpacmittal

ListItem has been giving me performance issues, so it's likely this is related to https://github.com/callemall/material-ui/issues/1501

t1mmen avatar Nov 26 '15 17:11 t1mmen

Very slow for me as well, especially with a lot of nested elements, had to optimize rendering as little as possible each time.

TrySpace avatar Dec 16 '15 14:12 TrySpace

I'm willing to looking into performance issues, but it's been a while since I've used Cordova. Would somebody be willing to create a cordova/material-ui project on github that reproduces some performance issues so that we can look at it?

newoga avatar Dec 17 '15 18:12 newoga

Agree that Cordova performance on Android is not great, in fact Android performance in general is not as good as it should be. iOS is much better and almost feels like native, even on older phones, but you need Fastclick to make it feel responsive.

For some reason there seems to be input lag on Android even when using content="width=device-width, user-scalable=no".

svk31 avatar Jan 28 '16 08:01 svk31

@newoga last time I checked we were having a lot of wasted rendered elements when scrolling a simple list. (Same on desktop but less visible without React.Perfs).

cgestes avatar Feb 04 '16 00:02 cgestes

Thanks @cgestes, this is true. A lot of components would significantly benefit from a proper implementation of shouldComponentUpdate. There could be other factors such as window listeners that might be related but I haven't dug deep in it. I know a lot of other high performance components in other projects that have "lists" of content lazy render components which is something our components don't currently do. It's all something we need to investigate.

newoga avatar Feb 04 '16 01:02 newoga

If I had to take a guess, there's nothing wrong with Material-UI specifically with Cordova that is causing it to be slow. I think that Material-UI just still needs a lot of performance optimizations that apply to both web and mobile and since mobile generally is slowly than desktops, it's a lot more noticeable.

newoga avatar Feb 04 '16 01:02 newoga

Agreed @newoga, that's one of the drawbacks of web-development on a decent desktop pc, you won't notice it has a heavy load until you try mobile or some raspberry pi.

TrySpace avatar Feb 04 '16 14:02 TrySpace

@oliviertassinari , @felarof99 , @cgestes Maybe this is not the place but sure you know about the subject... I'm writting a small react-material-ui app for demo purposes and I would like to test it with Cordova. How is your development flow? I mean, is it like two phases? First webpack & web testing and then two builds? One with webpack and the other with Phonegap? If you use plugins so it must be tested in the phone/emulator, isn't this way slow? Any workaround?

juanda99 avatar Jun 02 '16 07:06 juanda99

@juanda99 I'm personnaly not running any e2e test on the Cordova platform. However, I'm running them on the browser / server platform. Those two environements are close enought for my tests.

oliviertassinari avatar Jun 02 '16 08:06 oliviertassinari

I have developed a little framwework that helps in building such kind of applications; you can find it here: CReMA

pinturic avatar Jan 23 '17 22:01 pinturic