219 points · by Aissen · 15y ago · 104 comments
It doesn't say _why_ GPU rendering isn't much faster than CPU rendering on Android, it doesn't say why using OpenGL adds 8 MB to the RAM overhead to a process (something I can hardly believe by the way), it glosses over the fact that even though you _could_ render some things at 60 fps using just the CPU, that still means these CPU cycles can't be used for anything else, it doesn't mention the fact that GPU rendering is almost always more power-efficient than CPU rendering, and it doesn't differentiate at all between _what_ can efficiently be rendered by the Android hardware rendering and _how_, besides making the distinction between compositing and 'rendering in a window'.
The final comment about memory bandwidth also makes little sense when talking about CPU rendering vs GPU rendering. Most mobile GPU's use some form of tile-based deferred rendering that allows the use of dedicated on-chip local buffers and efficient caching, to greatly reduce RAM bandwidth pressure. If anything suffers from constrained RAM bandwidth, it's CPU rendering.
From a technical perspective this article is a very naive analysis, at best.
I'm surprised that many people are still bashing UI responsiveness/performance. I've held and played with many devices (including, but not limited to, iphone 3 and 4) and I can't really say what's bothering so many people. For me, every android device that I've used in the last 2 years feels fast and responsive. I'll just go out and say that it's a non-issue for mainstream user.
Might also be why the "mainstream" is primarily using Apple iPads/iPods/iPhones vs the myriad of Android devices available.
What bothers people is that when you swipe from screen 1 to screen 2, there can be a > .5 second delay. It doesn't feel remotely "natural" for something that you're physically touching and supposedly interacting with.
Which mainstream? Last time I looked Android market share was substantially higher than iOS.
I don't believe the reason for that is UI responsiveness (also, I don't agree with your 'primarily' assessment, but let's not chew on that). In my opinion, the differences are so small that UI performance just isn't an issue. There are other areas where iDevices are noticeably better compared to every competing device.
>What bothers people is that when you swipe from screen 1 to screen 2, there can be a > .5 second delay
Hm, I don't remember that ever happening to me in the last ~2 years with two devices that I've used most: nexus one and motorola defy. But ok, I grant you that it can happen. So what? I've also seen an iPhone freeze completely.
They ultimately, however, don’t matter†. If scrolling on one device makes me want to throw the device at the wall while on another device I don’t even notice that I’m scrolling, then that’s a problem.
I’m looking forward to trying out an Android 4.0 device to see whether I still want to throw it at the wall. That’s the only thing that matters to me. (Lagging is only part of the problem and occasional lagging really isn’t a problem. What always annoyed me much more was the delayed reaction. I swipe, nothing happens, the page scrolls. That’s extremely annoying.)
—
† They obviously do matter. Different implementations lead to different results. But only talking about the implementation and ignoring the results misses the point.
Meanwhile, at Apple, they would have got it right in version 0.1, and Steve Jobs would treated that as prototype quality and made the team do 10 better variations.
Meanwhile, the current generation of dual core Android phones have hardly any lag issues anymore.
So... laggy sometimes, but still smooth scrolling.
Every Android device I've tried (just tried a couple tablets at a Best Buy this week) have been consistently laggy (response times to swipes) and choppy scrolling.
Just FYI.
I can barely stand the, in my opinion, horrible mouse acceleration in OS X and knowing apple I can imagine that they feel that giving me the option to disable it isn't user friendly.
Am I the only person in the world for whom the inertia of a scrollable area at rest, tending to stay at rest _is_ what feels right?
Android's Webview unfortunately requires a rewrite from scratch. It just doesn't work as soon as the webview is more than a static page. Css Animations don't play anywhere near fast enough, there are furious hardware acceleration glitches whenever the touch keyboard pops up, touch events are slow as hell, etc.
The article only touches the surface of the problems with the Webview component. At this point we don't care about scrolling. since one pretty much has to hack a custom Webview component just to avoid all the hardware glitches, display artifacts, buggy input handling, terrifying variations of performance from device to device...
Two exceptions: Audio latency. It is impossible to write certain classes of table applications for Android right now, because no priority was given to having a low-latency audio subsystem. Its at least as big a mess as display acceleration.
I don't know the technical details (though I'd assume hardware acceleration is a big deal), but evidently Apple can achieve a good user experience while consuming far less resources. It's taken Android years, and I probably have to buy a new device.
* I have up-to-date firmware. Maybe that helps.
The reason iOS is so silky smooth is because each view in UIKit is backed by a CoreAnimation layer which will be a pixel buffer in hardware. This means that if you move a UIView in iOS, no new rendering needs to be done of stuff that was "uncovered" by moving the view since each UIView has the full contents of its view stored in its CALayer. All that needs to happen is all of the layers are composited in their new positions which hardware will blazingly fast. However, as I understand it in Android, each Window (containing multiple Views) is one pixel buffer in hardware. Each view then draws in to that. This means that if you move a View in android, another view will be "uncovered" and since that area of the screen isn't stored somewhere, it has to go down the view tree rendering the now uncovered area of the screen. Even if that rendering is hardware accelerated, it's still going to be muuuuuch more work that just recompositing all the layers on the screen as in iOS, I mean imagine if there's text uncovered there? That's not going to be quick.
Now, there are downsides to iOS's approach - it uses a bunch more memory. But the upsides are basically what makes iOS good - all those silky animations. Android's just getting to a similar level of smoothness, but mostly only through better hardware.
(Caveat: How android works may have changed since I last looked, but that just makes the mystery of lack of smoothness even more interesting ;-) )
(Further reading: http://developer.android.com/reference/android/view/View.htm... )
Edit: Also, I missed where she said that in her post: "Starting with 3.0, if you set the flag in your app saying that hardware accelerated drawing is allowed, then all drawing to the application’s windows will be done with the GPU. The main change in this regard in Android 4.0 is that now apps that are explicitly targeting 4.0 or higher will have acceleration enabled by default".
Unfortunately only the the Samsung Galaxy Nexus has Android 4 and I'm not sure there's anything other than a few tablets that have Android 3?
Google suggests toggling between LAYER_TYPE_NONE & LAYER_TYPE_HARDWARE pre/post animations. This need to actively manage view cache behaviour probably leads to developers being unaware of what to do.
LAYER_TYPE_HARDWARE enables smooth hardware-backed scrolling but glitches badly when the soft keyboard is visible (no resizing/panning of the webview, multiple seconds of delay between key type and text updates inside textfield forms).
LAYER_TYPE_NONE makes scrolling in the webview unbearably stuttering, but at least the soft keyboard becomes responsive, the webview pans correctly to show the field in which you're inputting text, and the key types are instant.
On top of that, there is the problem that you don't have access to keyboard show/dismiss events, so you have to inject javascript code to catch those in every page you plan your webview to display. This is at least the case on the Motorola Xoom and the Acer Iconia tablets running the latest versions of honeycomb.
Doesn't this make Android look even worse? I.e., "Android already has hardware acceleration but still doesn't seem to perform very well" means any hope of flipping some magical GPU acceleration switch and instantly fixing the problem is gone.
I don't use any apple products but I get tired of Google touting how much better 4.0 is when most people are locked into phones running 2.2 or 2.3 for years into the future.
Way to take what started as a reasonable post and trash it with a needless, baseless insult.
The post spends pages on how hardware acceleration in android is just fine, but it completely ignores the actual problem. This is like a man in court for a DUI who bases his whole defense around the fact that he has a legitimate driver's license.
Going from Heinlein's razor, I assume that google does not know the cause of the problem. The alternative is that google is deliberately trying to mislead us by ensconcing the clunkiness issue within the hardware acceleration issue in the belief that by disproving the software acceleration claims they can nullify the elephant in the room: poor user interface performance.
There is still a limit to how much the GPU can do. A recent interesting example of this is tablets built with Tegra 2 -- that GPU can touch every pixel of a 1024x800 screen about 2.5 times at 60fps. Now consider the Android 3.0 tablet home screen where you are switching to the all apps list: you need to draw the background (1x all pixels), then the layer of shortcuts and widgets (let’s be nice and say this is .5x all pixels), then the black background of all apps (1x all pixels), and the icons and labels of all apps (.5x all pixels). We’ve already blown our per-pixel budget, and we haven’t even composited the separate windows to the final display yet.
I find this bizarre. Are all of these drawing operations using alpha blending (using translucency)? If so: is that strictly necessary for the entire area of all of them?
If they aren't using blending, why on earth do they have so much overdraw? The GPU could reduce that to touching each pixel exactly once by using the Z buffer and drawing in front-to-back order.
Just put any newest and fastest Android phone with dual-core CPU next to iPhone, or even worse WP7 which essentially works on two years old hardware, and everyone can see the difference. I don't care if it's software or hardware, I'm not interested in excuses about the work in the GUI thread. What I'm care is - the phone is something I touch. If I don't have immediate response to my gestures, the device is useless to me. As simple as that.
The post is relating facts about "how graphics rendering works on Android", it says so right at the top. I see absolutely nowhere that it says anything like "there's nothing wrong".
"When you refer to something as a fact or as fact, you mean that you think it is true or correct."
See also: http://www.thefreedictionary.com/fact
Although, the Wikipedia disagrees: http://en.wikipedia.org/wiki/Fact#Etymology_and_usage
In the opinion of the referee, the ball did not cross the goal line between the posts and below the crossbar despite the ball actually doing so.
However the fact is in accord with the referee's opinion, not the actual path of the ball.
This is not only a bad experience for users but also is one of the most difficult parts when developing Android apps.
http://www.google.com/events/io/2011/sessions/accelerated-an...
I think you're just repeating the meme of "lol Android graphics are bad" which hasn't been true for at least 2 years, even with relatively weak phones (like the Optimus X)
ICS definitely has little scrolling lag (tested on Nexus S)
I can understand why Andoid would have theirs set as they do, but I also understand how someone used to iOS could find it unpleasant.
It's all just software. The only thing that matters is how fast it is.
My point is, software is rendering the graphics. Either it's software running on one chip, or it's software on another chip. That's irrelevant. What matters, is how fast the graphics are rendered.
What's interesting is not only how fast the graphics are rendered, but the graphics performance compared to power usage. If the software stack doesn't give you a big performance / watt advantage when using a GPU, that's the fault of the software stack and will make that stack perform worse compared to one that does make use of hardware acceleration.
Software rendering means that it's handled detail by detail by software on a general-purpose computation device.
Hardware rendering means that the software instead initiates complex actions on swaths of the screen at a time by triggering highly-specialized hardware.
One method is orders of magnitude faster than the other, but limited in scope. It's a fool's errand to try to conflate them.
A crappy 'hardware' accelerated GPU can be slower than a 'software' framebuffer write.
My point was that saying "It's hardware accelerated" is meaningless marketing speak.
No, its not irrelevant. The terms have meaning, regarding the separation. And while it may technically be a misnomer, feigning ignorance to the misnomer to try and point out the misnomer to people who already know about it is not only arguing semantics, but doing so in least constructive way possible.
To address your other post that its all marketing speak, well no, not really. In discussions, what gets called hardware or software conveys meaningful information, but it is highly context sensitive to the bits being discussed at the time, because technically all computing is some combination of hardware and software.