IOS6 html hardware acceleration changes and how to fix them
indiegamr.com
indiegamr.com
I'm used to the PC world where battery/heat are hardly a problem and software rendering is usually a bad thing when hardware rendering is available.
Again: these are mostly assumptions, I'm not a hardware architect!
The biggest cost is memory. Every pixel of hardware accelerated web content gets 4 bytes of memory. This adds up quickly, especially since any content that overlaps hardware accelerated content must become hardware accelerated as well.
The other big cost, as olsn already pointed out, is that blending these offscreen images onto the screen takes time and power on every frame. In extreme cases this can cause scrolling to stutter.
See the "Optimizing Web Content in UIWebViews and Websites on iOS" session from WWDC 2012 for more information about this.
The bottom line is, that Apple forces developers to take care of this instead of having everything automatically hardware accalerated and therefore shortening the battery life of iOS devices(by a lot I'm guessing).
Does rendering a few more polygons actually kill battery life that badly? I believe much of the OS is already hardware accelerated anyway.
Neither why their mighty Nitro JavaScript Engine can't handle smoothly a setTimeOut based fade in/Out.
Google Chrome on 8 years old hardware (less powerful than actual iPhone hardware) renders the moving web better.
Safari is a poor mobile browser.
"WebKit on iOS now supports the requestAnimationFrame and cancelAnimationFrame methods in JavaScript, as described here: http://www.w3.org/TR/animation-timing/*
That link in turns states:
"script-based animations are most often performed by scheduling a callback using setTimeout or setInterval and making changes to the DOM to effect the animation in that callback.
A disadvantage of this approach is that the author of the animation script has no idea what the ideal frequency for updating their animation is. Instead, the easiest way forward for the author is to simply call setTimeout with a very small value, which in practice will be clamped to some minimum time like 10ms anyway. It likely won’t be the case that 100 updates per second are required for the animation, especially if the page is in a background tab or the browser window is minimized."*
So, it looks like setTimeOut is discouraged in favour of this (draft) standard. Given that, I would understand that Apple would optimize setTimeOut for minimal power use, rather than maximum update frequency (not that I have the faintest idea about how one should go about that)
Also: have you tried your claim about Chrome's performance in a similar amount of memory as what iOS has to deal with?
The WebKit developers spend all day trying to drive the web forward. That's what they do. They're not pulling their punches. Try hanging out in #webkit on irc for a bit and see if you think they want the web to lose to native.
No need for workarounds and hints in an application whose main function is to display _documents_.
The issue affects websites as well as hybrid apps. Given that this change is poorly documented by Apple, and it directly affects a JS plugin I'm working on, I'm quite grateful for the OP sharing their findings.
You cannot try to bend something thought to display documents into some kind of application, and they complain about lack of hardware acceleration.
It's ultimately the developer's responsibility to make good choices on behalf of users, whether on native, hybrid, or the mobile web.