4 ms·
I work on Firefox OS so probably worth taking bias into account. On low end devices fxos runs reasonably well but with noticeable lag, we have put in huge amou
by daleharvey 12y ago
I work on Firefox OS so probably worth taking bias into account.
On low end devices fxos runs reasonably well but with noticeable lag, we have put in huge amounts of effort on the low end to make that possible. On high end devices the 'native' fxos application are incredibly snappy and there has been very little done to improve performance on high end devices.
Most of the stuff we have done is common sense, some you will see a lot of people doing, some almost no people do.
1. Shorten the path to rendering first screen, dont block on reading some data, load all scripts async etc.
2. Never animate top / left, use CSS transitions for everything.
3. We use 'will-change' to ensure that the graphics are properly layered for when they do animate (https://developer.mozilla.org/en-US/docs/Web/CSS/will-change https://developer.mozilla.org/en-US/docs/Web/CSS/will-change)
4. Offline assets, in fxos we use packaged apps for various reasons, however one of the benefits is that reading from the filesystem is faster than reading over the network.
If I had one performance tip for web developers, look into how far you can use appcache to store resources offline (or if your feeling fancy, service workers). Offline capable web apps have a night and day difference.
- jordanlev 12y ago> look into how far you can use appcache to store resources offline Maybe this question isn't specific to firefox OS, but... what is the benefit of using appcache -- doesn't the browser already cache assets that it has loaded?
- daleharvey 12y agoIt tries to, but browsers generally load a lot of assets meaning high chances of eviction etc along with the problems in dealing how servers / browser deal with cache directives. I mean try it against 2 fairly comparable static sites - http://backbonejs.org/ http://backbonejs.org/ + http://pouchdb.com/ http://pouchdb.com/, keep on refreshing them, that case is gonna give you the highest cache hit rate you can get and its still noticeable.