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


Decoding What The Eye Sees
17/05/2018

The latest breakthrough in brain function is the reconstruction of what the eye sees from the activity of neurons that form the optic nerve. Man machine neural interfaces get closer.



Firefox 60 Supports WebAuthn
17/05/2018

Someday all our problems with passwords could be a thing of the past. Firefox 60 is the first browser to support WebAuthn, a new standard for web authentication developed by the W3C in collaboration w [ ... ]


More News

 

 
 



Comments




or email your comment to: comments@i-programmer.info

Last Updated ( Wednesday, 24 January 2018 )
 
 

   
Banner
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.