|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.
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
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.
or email your comment to: email@example.com
|Last Updated ( Wednesday, 24 January 2018 )|