How to optimise for Chrome Android

Hi there,

We are developing a hybrid app which includes to pages with ember apps. On iOS everything is fine, WKWebkit is really fast.

On Android we are bundling the crosswalk browser (= Chrome), which we learned, has some optimisation issues. At the moment we are observing this when we load the respective webpage. Observations:

  • the internalRequire of modules takes very long (almost 3 seconds) with single compiled (not minified) vendor production javascript file, from cache.
  • not as dramatic, but equally the startup of the app itself

I would really be grateful for some feedback on how we can improve this situation:

  1. Is there a way to reduce the dependencies, e.g. require fewer internal modules? Is that even possible?

  2. Any hints on speeding this up in general. Flags on XWalk/Chrome, new canaries that work better?

  3. Has anyone tried creating an ember initialised page? Maybe something that has the ember vendor modules already initialised?

Trace of our application start: ember 2.2, ember data 2.2, jquery reduced custom build, all assets from cache, nothing fancy otherwise. The first big chunk is until page is ready, the second chunk is ember app starting. Measured on a Sony Xperia M2, Android 4.4.2.

Cheers Steffen

Out of curiosity, those internalrequire are for your application’s modules or for ember internals?

The internalRequire are all from ember.

function internalRequire(name, referrerName) {
  var exports = seen[name];

I’m sorry Steffen, but the Android in terms of executing JS is still the worst OS. I’m not sure of how can this be improved, but there is a topic already about that on Discourse: The State of JavaScript on Android in 2015 is... poor - Discourse Meta

Thanks for the hint, I have read that thread and all discussions around it.

I wonder what people have done to mitigate the issue. Obviously we can’t change Chrome, but I am sure there are Tweaks. Every 500 ms saved is a slightly happier experience.

Steffen, sorry for the late response :sweat: My first thought is that it could be a good idea to render stuff on the server side for Android devices, or any other mechanism to minimize the amount of JS to be executed on these devices.

ping me on slack (@runspired) or ask in the Slack #performance or #mobile channels, there’s only so much you can do for Android, but I can help you optimize this stuff.