Some interesting optimizations in here, but I'm curious about this one in particular:
> With the Anniversary Update, Microsoft Edge only executes background JavaScript timers once per second in background tabs. More importantly, these timers are coalesced with other work happening across Windows. Microsoft Edge doesn’t wake up the hardware to perform work. Instead we tag along with other work happening across the system, and then quickly yield, allowing the hardware to enter a low power state.
Are there any implications for web techs (maybe like WebTorrent?) that do need to run JS constantly in the background?
In Safari, which slows background JavaScript down or stops it altogether, music stops playing occasionally on Soundcloud when a song ends. The only option to prevent this is to make the Soundcloud tab the sole tab in the browser window. The window can be in the background but the tab is not treated as background tab because it is the active tab in the window.
I personally would be happy if all background tabs would stop completely if they don't have focus for a configured amount of time, and don't have a network connection currently in use.
To keep a tab active pin it, those tabs will be immune from that.
And not for power consumption but simply for browser speed!
I'm not sure about Edge in particular, but on most platform runtimes "timers" are separate from IO-availability-triggered asynchronous events. When a WebRTC data connection signals its send channel has become unblocked/receive channel has data available, a handler will be called right then; there's no timer involved. Timers are just for things that have no relevant IO to control them, like animations.
That was my understanding as well, but the improvement in CPU utilization they showed [0] seemed to be a bit too dramatic to be attributed solely to more infrequent timer ticks. I guess they must done some serious cherry-picking on the sites used for that benchmark.
> With the Anniversary Update, Microsoft Edge only executes background JavaScript timers once per second in background tabs. More importantly, these timers are coalesced with other work happening across Windows. Microsoft Edge doesn’t wake up the hardware to perform work. Instead we tag along with other work happening across the system, and then quickly yield, allowing the hardware to enter a low power state.
Are there any implications for web techs (maybe like WebTorrent?) that do need to run JS constantly in the background?