DevNebulae
DevNebulae

Reputation: 4916

Improving performance of Aurelia framework on mobile devices

The scenario

I am creating a web application for mobile devices which should be as Android-like as possible, without the need of installing any other software than the browser. With Android applications there are a lot of gestures you can use instead of long actions to do an action. I can create gestures with jQuery just fine by using event listeners on the touch events (touchstart, touchmove, touchend). I used jQuery in combination with Aurelia and I am starting to notice that the framerate of these animations is not higher than a stable 30 frames per second I am aiming for. On PC it's just fine, but a PC is miles ahead specification-wise than a mobile phone.

The question

How can I toggle modules off I am not using to increase the performance of Aurelia-bases applications on mobile devices?

Upvotes: 2

Views: 1372

Answers (1)

Alexander Mikhalchenko
Alexander Mikhalchenko

Reputation: 4565

Rollup allows you to take only the code you need.

As far as I understand, you don't have a problem yet, so you have some code running on PC and you think it might lag on phones/tablets.

So let's get a few things clear, because there might be no problem at all:

1) Aurelia is fast.

Yup, the loading screen fades and then the magic goes really fast.

Considering the Angular vs Aurelia vs Angular 2 vs React vs whatever speed test, you can check out this:

Aurelia - Angular 2 - Angular 1 - React

For those who don't want to click: according to that test, Aurelia is the fastest of those four.

Also, as Rob Eisenberg stated:

In our initial perf experiments, Aurelia appears to be faster than Angular 1, Knockout, Durandal and Ember 1...without any performance optimization work. After we optimize, we expect to be much, much faster. I doubt we will have a problem in comparison to Angular 2.0.

2) Take the code you need

With Rollup you can take only those parts of libraries you need. There's a pull request for Rollup to be used in JSPM.

3) Animation

It's kinda a personal story, but anyway.

I've got some experience creating apps for WebOS (used on LG TVs that... well, have a poor video card) and we use Aurelia there. First we tried jQuery and Angular, we had huge lags. It lagged so bad that our team was insanely digging through the code to optimize everything we can, and in the end... it was css transform used by some third-party library (facepalm).

To sum up:

  • Use Aurelia, it's awesome
  • Mobile devices are powerful nowadays
  • Big frameworks are optimized, don't worry
  • Beware of jQuery and jQuery plugins ;)

Upvotes: 7

Related Questions