3 ms·
It's not that hard to optimize for power draw in software if you're willing to do the work to measure and tune. Lots of simple optimizations can produce huge ga
by kevingadd 13y ago
It's not that hard to optimize for power draw in software if you're willing to do the work to measure and tune. Lots of simple optimizations can produce huge gains, whether it's using the correct timer APIs to allow the OS to coalesce timer events (Raymond Chen wrote a blog post about how this allows the CPU to stay in sleep mode longer on Windows by serving all timers on say, 1000ms intervals instead of 999ms/1000ms/1001ms, etc), intentionally clamping your rendering rate to 30hz instead of 60hz, using hardware vsync instead of trying to do vsync in software (hardware vsync is often much cheaper because it can rely on the GPU clock/interrupts instead of busy-waiting or CPU timers), or simply finding ways to do less unnecessary work.
The interesting thing though is that power draw can run counter to other goals. Getting the best possible framerate can often mean higher power draw, even though a higher framerate usually means your code is running 'faster' - if you go from running on one core to four cores, you are probably increasing the CPU's power draw (and heat dissipation too, which means more power spent running the fans). But maybe if running on four cores lets you finish early enough, you can put the whole app to sleep while you wait for the next vsync, saving power. Ultimately, you have to test this stuff, then tune, then test again.
I expect IE's power savings are mostly due to its architecture. IIRC they do a lot of their isolation via threads instead of processes, which means they can use much cheaper communication mechanisms between their isolation zones, and that's going to add up. I expect their rendering architecture for plugins is also significantly more efficient than NPAPI (though I wonder if it can beat PPAPI), since they have the ability to more or less dictate how things should be done, and ActiveX plugins have been using GDI/DirectX for ages, automatically tapping into hardware surfaces and acceleration. IE9/IE10 also led the way in terms of fast, pervasive hardware acceleration for browser rendering - while Firefox and Chrome had HW accel first in certain scenarios, IE was early to the game when it comes to using hardware to render entire pages.
P.S. People who say power draw doesn't matter in a browser have obviously never used a laptop or a cell phone before. Do you think Apple and Google don't try to optimize power draw on iOS and Android devices?
- iamshs 13y ago"IE9/IE10 also led the way in terms of fast, pervasive hardware acceleration for browser rendering - while Firefox and Chrome had HW accel first in certain scenarios, IE was early to the game when it comes to using hardware to render entire pages." That would explain why the power draw for other browsers was fluctuating depending upon websites surfed and IE seemed kind of consistent.
- wtallis 13y agoFrom the study: "In addition, at the request of Microsoft we set the JavaScript timer frequency to “conserve power” in the Windows power options. We found, however, that the default Javascript time frequency for all computers tested was set to “maximum performance.” We did not investigate the impact of this setting upon browser power draw." So yeah, IE got some optimization applied, and unfairly so, since the other browsers were run with default settings.
- iamshs 13y agoNo, default power settings on a laptop do that, if it is put in a power saving or Balanced mode. It is not a specific IE option, but Windows OS option.