Firefox 58 - Tab Throttling, WebAssembly, Promise Finally And Progressive Web Apps
Firefox 58 - Tab Throttling, WebAssembly, Promise Finally And Progressive Web Apps
Written by Ian Elliot   
Wednesday, 24 January 2018

Firefox 58 has just been released to end users, but it has some interesting changes for programmers as well Mozilla really does seem to be bringing Firefox into the 21st century, leaving its legacy architectural, XUL and XCOM well behind while completely re-engineering the browser.

 

One of the problem we have with browser makers is that they have taken the place of the operating system makers. Once what our programs could do or not do was controlled by the mightly Microsoft or the Linux gods, but now it is the browser that matters.

We mostly just expect browsers to implement standards, but lots of the things that they do are outside of any standard. In particular, how fast they work alters what our programs can reasonably do. Any optimizations that modify the way programs work are also generally not welcome.

Firefox is getting faster and uses fewer resources, and this is good. The biggest improvement is probably due to the use of additional threads during rendering.  The new renderer is increasingly making use of hardware acceleration, but in Firefox 58 the the painting process has been moved to a separate thread. This frees the main thread to run your code, which has to be good. The best part is that the speed improvements are not dependent on graphics hardware - this is one advantage we can all have.

omtp

 

There might be strange effects in using a thread for rasterisation, but background tab throttling is certainly going to cause some trouble.

"To reduce CPU usage overall, Firefox 58 will begin throttling the timers (specifically setTimeout/setInterval) in background tabs. These timers will still fire, but at a reduced rate. Exceptions exist for WebRTC/WebSocket connections as well as audio playback."

It makes you wonder who setTimeout function belongs to! In fairness, setTimeout and setInterval only promise time periods at least as long as specified, and Chrome has been doing this for some time.

WebAssembly is also running faster due to streaming compilation. This sounds advanced, but basically all it means is that the compiler starts work on the code as it is being downloaded, so eliminating the pause when the download is complete. At the moment the big problem with WebAssembly for the average programmer isn't how fast it runs, but the lack of easy-to-use tools to create binaries.

One standard that has been updated is the addtion of  the.finally merthod to the Promise object to execute any code the needs to be run no matter what. If you want to write modern code you most likely should be using async and await rather than raw Priomises.

Finally the relentless march of the Progressive Web App continues. If you now browse to a website, served over HTTPS, with a vaild manifest then the user can click "add to home screen". You don't need to have a ServiceWorker registered for Firefox, whereas you do for Chrome. For reasons that aren't 100% clear this only works on Firefox for Android - desktop users clearly don't need web apps.

In addition when the end user installs or upgrades they are shown a splash page that encourages them to install Firefox for Android.

firefoxquantum

More Information

Firefox 58: The Quantum Era Continues

Firefox 58 for developers

Related Articles

Firefox Quantum - Fast For Good

Mozilla Firefox Replacing Gecko With Servo

Firefox Developer Edition Goes Quantum

Firefox 55 Is Great Yet Its Marketshare Is In Freefall

Firefox 54 Multi-Process and Faster - Can It Woo Us Back

Chrome Declared Winner

Firefox Makeover Loses Devs

First Contact - Firefox & Chrome WebRTC

Mozilla WebRTC Goes Mainstream

Firefox 42 Developer Edition

 

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on, Twitter, FacebookGoogle+ or Linkedin.

 

 

Banner


Open Media Alliance AV1 Is Better Than JPEG
23/01/2018

The Alliance for Open Media's work on an alternative video codec is making progress with tests in a trial version of Firefox showing that the Alliance's AV1 video compression technology produces video [ ... ]



Intel Ships New RealSense Cameras Is This The Kinect Replacement We Have Been Looking For?
26/01/2018

With Microsoft stopping the production of the Kinect, the Intel RealSense family of cameras seems like the obvious replacement. But there are problems - can we trust Intel to keep the hardware in prod [ ... ]


More News

 

 
 

 

blog comments powered by Disqus

Last Updated ( Wednesday, 24 January 2018 )
 
 

   
Banner
RSS feed of news items only
I Programmer News
Copyright © 2018 i-programmer.info. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.