Former Google intern explains why UI lag occurs more often in Android than iOS

Posted:
in iPhone edited January 2014
A former intern for Google's Android team has provided explanations for why Android experiences more touch interface lag than competing mobile operating systems from Apple, Microsoft and Research in Motion.



Undergraduate software engineering student Andrew Munn posted his observations on Google+, as noted by Cult of Mac. He did disclaim, however, that he will be starting an internship with Microsoft's Windows Phone team in January, adding that any opinions from the report were his alone.



According to Munn, Android has a difficult time dealing with the touch interface because it handles rendering "on the main thread with normal priority," as opposed to iOS, which treats UI rendering with real-time priority. He cites examples of website loading and the Movies app on Android where the operating system will continue to load while registering touch input.



Munn identified several other factors that contribute to UI lag on Android. For instance, the photo gallery app in either Android 3.0 Honeycomb or 4.0 Ice Cream Sandwich is capped at 30 frames per second in order to prevent a noticeable "hiccup" at 60 FPS.



"Capping the frame rate at 30 fixes the hiccup problem at the expense of buttery smooth animations at all times," he said.



The author also pointed to hardware issues for Android. According to him, Nvidia's Tegra 2 chip limits Android because of its low memory bandwidth and lack of NEON instruction set support. Tablets based on Honeycomb would be "better off with a different GPU," such as the Samsung Hummingbird or Apple A4.



Munn noted that Android "has a ways to go" before achieving more efficient UI compositing, especially when compared against Apple's iOS.



"On iOS, each UI view is rendered separately and stored in memory, so many animations only require the GPU to recomposite UI views," he said. "GPUs are extremely good at this. Unfortunately, on Android, the UI hierarchy is flattened before rendering, so animations require every animating section of the screen to be redrawn."



Another reason for the lag is the limitations of Android's Dalvik virtual machine, which is "not as mature" as a desktop-class Java VM, Munn said. However, the issue with Dalvik will be offset by hardware acceleration from Ice Cream Sandwich on and improvements to Dalvik.



But, in spite of the improvements, Munn believes the Android user interface "will never be completely smooth because of the design constraints" that limit UI rendering to the main thread of an app with normal priority.



"Even with a Galaxy Nexus, or the quad-core EeePad Transformer Prime, there is no way to guarantee a smooth frame rate if these two design constraints remain true," he said. "It?s telling that it takes the power of a Galaxy Nexus to approach the smoothness of a three year old iPhone."



According to Munn, the reason behind the design change is that the original Android prototype didn't have a touchscreen, as it was meant to be a BlackBerry competitor. As such, Android's architecture is meant to support a keyboard and trackball. Munn further claimed that after the original iPhone arrived in 2007, Google rushed to complete Android, but "it was too late to rewrite the UI framework."



He cited Windows Mobile 6.5, BlackBerry OS and Symbian as examples of other older operating systems that suffered similar problems with touch performance. Microsoft, RIM and Nokia have all abandoned those OSes in order to start from scratch. "Android is the only mobile OS left that existed pre-iPhone," the report noted.



Android Software Engineer Romain Guy admitted as much when he said that choices made years ago had contributed to work the team has to do now.



"Having the UI thread handle animations is the biggest problem," he said. "We are working on other solutions to try to improve this (schedule drawing on vsync instead of block on vsync after drawing, possible use a separate rendering thread, etc.) An easy solution would of course to create a new UI toolkit but there are many downsides to this also.?



According to the report, those downsides include the fact that apps would have to be rewritten to support the new framework, Android would need legacy support for old apps and work on other Android features would be held up while the new framework was being built.



"However, I believe the rewrite must happen, despite the downsides. As an aspiring product manager, I find Android?s lagginess absolutely unacceptable. It should be priority #1 for the Android team," Munn said.



UI Lag has long been an area for which reviewers have criticized Android. One recent usability study by Jakob Nielsen on Amazon's Android-based Kindle Fire found erratic scrolling and "huge lag in response after pressing command-buttons." Nielsen suspected that "sloppy programming" was causing the issue.



The New York Times' David Pogue also took issue with the Kindle Fire. "Animations are sluggish and jerky -- even the page turns that you'd think would be the pride of the Kindle team," he said in his review. "Taps sometimes don't register. There are no progress or 'wait' indicators, so you frequently don't know if the machine has even registered your touch commands. The momentum of the animations hasn't been calculated right, so the whole thing feels ornery."



Munn himself viewed the issue as damaging to Android's image. He also saw it as a violation of Google's guiding principles, which have generally led to faster, optimized products. Finally, he mentioned that UI lag breaks the direct 1-to-1 relationship that touch screens offer.



"The device no longer feels natural. It loses the magic. The user is pulled out of their interaction and must implicitly acknowledge they are using an imperfect computer simulation. I often get ?lost? in an iPad, but I cringe when a Xoom stutters between home screens," he said.



To conclude, the report ended on a more upbeat note, with Munn voicing his belief that the Android rendering framework is in the hands of a capable team. "I know they will have it eventually," he said.
«134567

Comments

  • Reply 1 of 138
    Funny out pre iPhone is used as a distinction when the iPhone is OS X, which is NeXTStep, which was designed in the 80s.



    Certainly Apple designed Cocoa Touch specifically for the iPhone, but much of what is discussed here (i.e. caching object bitmaps) are things NeXTStep 1.0 did correctly. Which enabled things like live scrolling, live window movement, etc on the desktop with the same fluidity as the UI on iOS devices.
  • Reply 2 of 138
    majjomajjo Posts: 574member
    despite what is said in the article, it seems that a smooth UI isn't that high of a priority for google. ICS seemed like the perfect opportunity to address this with a bunch of new guidelines for apps to conform to the unified tablet and phone OS, but google didn't address this issue at all.



    and I agree that lag is a lot worst on a touchscreen. With physical buttons you can fall back on tactile feedback to be assured that you pressed something. On a touchscreen, any lag causes immediate doubts on whether you actually pressed anything.



    I hope that google eventually gets this right.
  • Reply 3 of 138
    haggarhaggar Posts: 1,568member
    Is there an explanation for the UI lag on iPhone 3G running IOS 4, even with the IOS update that was supposed to address that?
  • Reply 4 of 138
    asciiascii Posts: 5,936member
    Has there ever been a Java GUI that didn't feel sluggish, even on the desktop?



    But he is right, user experience is everything on these devices, so if their GUI framework is not up to scratch, it's needs to be job 1.
  • Reply 5 of 138
    apple ][apple ][ Posts: 9,233member
    And that is one of the main reasons why every Android device has sucked so far. Some pathetic people even go as far as denying that there is any lag on Android. They're either serial liars or they're blind.



    On a touch screen device, all user interaction needs to be instantaneous, not seconds after you press something. And everything needs to be smooth, not jerky.



    There's also another big thing that Android can not do well, it doesn't handle audio properly, and realtime music apps is something else that doesn't exist on Android, because of the terrible latency.
  • Reply 6 of 138
    MarvinMarvin Posts: 15,309moderator
    Quote:
    Originally Posted by ascii View Post


    But he is right, user experience is everything on these devices, so if their GUI framework is not up to scratch, it's needs to be job 1.



    It can't be though because it means having to rewrite hundreds of thousands of apps to take advantage of it. Apple made sure to get this right from the start and Google should have too - same with have 32-bit rendering in every part of the OS.



    I expect they will correct all the issues over time but the honesty of the engineer speaks volumes:



    "It?s telling that it takes the power of a Galaxy Nexus to approach the smoothness of a three year old iPhone."
  • Reply 7 of 138
    kotatsukotatsu Posts: 1,010member
    Quote:
    Originally Posted by Haggar View Post


    Is there an explanation for the UI lag on iPhone 3G running IOS 4, even with the IOS update that was supposed to address that?



    Or the lag on an iPhone 4 running iOS5. My iP4 is stupidly laggy since the update, it's almost like going back to my old iPhone 3G.
  • Reply 8 of 138
    notrsnotrs Posts: 46member
    Quote:
    Originally Posted by Haggar View Post


    Is there an explanation for the UI lag on iPhone 3G running IOS 4, even with the IOS update that was supposed to address that?



    Yes.. the hardware.



    Although when I had my 3G I used a jailbroken iOS 4 (with backgrounds and multi-tasking enabled) and didn't find it to be that bad. Periodically it would get a little sluggish and I would use SBSettings to free up some memory.



    The cold truth is that the hardware in the iPhone 3G is not really fit for running iOS 4. (It's like trying to run leopard on a G4 with only 1gig of ram. Sure, it will do it... but it will get sluggish on occasion.)
  • Reply 9 of 138
    bigbig Posts: 36member
    I'm going to be upfront that I'm a non-expert but I think this sounds so similar to the mindset of the folks in Redmond: any time Windows got more complicated and slow the solution was to throw faster hardware at the problem. It's a brute force approach in contrast to careful refining, optimizing, and perfecting.



    Android seems similar in that things such as processor type and speed are bandied about in marketing materials like celebrity name dropping at a party. The measure-bators boast about things like GHz and Snapdragon or Tegra or processor du jour. I probably used the wrong names but I don't care: consumers shouldn't need to know this sort of information. Really, it's not the name or speed of the processor that counts but how efficiently those cycles are utilized.



    I have an older iPhone, the 3GS. Its processor must be totally obsolete by now - I'm two cycles behind the latest and greatest iPhone. However, there is absolutely no lag on my touchscreen! I've used my friends' Android-based phones and touch-response lag was very distracting.



    I like my iPhone because it works well! Android just doesn't seem to be there yet. And if the intern is to be believed it sounds like it's due to some bad choices in the foundation of the Android OS...
  • Reply 10 of 138
    notrsnotrs Posts: 46member
    Quote:
    Originally Posted by kotatsu View Post


    Or the lag on an iPhone 4 running iOS5. My iP4 is stupidly laggy since the update, it's almost like going back to my old iPhone 3G.



    You probably won't like the aggravation, but if you restore your iPhone 4 from DFU mode and then set up as a new device it shouldn't be laggy.



    I have iOS 5 on my iPhone 4 and it runs like a dream.
  • Reply 11 of 138
    notrsnotrs Posts: 46member
    Quote:
    Originally Posted by big View Post


    I'm going to be upfront that I'm a non-expert but I think this sounds so similar to the mindset of the folks in Redmond: any time Windows got more complicated and slow the solution was to throw faster hardware at the problem. It's a brute force approach in contrast to careful refining, optimizing, and perfecting.



    Android seems similar in that things such as processor type and speed are bandied about in marketing materials like celebrity name dropping at a party. The measure-bators boast about things like GHz and Snapdragon or Tegra or processor du jour. I probably used the wrong names but I don't care: consumers shouldn't need to know this sort of information. Really, it's not the name or speed of the processor that counts but how efficiently those cycles are utilized.



    I have an older iPhone, the 3GS. Its processor must be totally obsolete by now - I'm two cycles behind the latest and greatest iPhone. However, there is absolutely no lag on my touchscreen! I've used my friends' Android-based phones and touch-response lag was very distracting.



    I like my iPhone because it works well! Android just doesn't seem to be there yet. And if the intern is to be believed it sounds like it's due to some bad choices in the foundation of the Android OS...



    I like your analogy. In both cases Microsoft and Google made the same mistakes: rush to release something to compete with Apple. (While sacrificing quality along the way)



    Imagine what Windows and Android would be like if MS and Google took time to do things right and proper the first time...
  • Reply 12 of 138
    apple ][apple ][ Posts: 9,233member
    Quote:
    Originally Posted by NotRs View Post




    Imagine what Windows and Android would be like if MS and Google took time to do things right and proper the first time...



    Android was made for these kind of phones. This is a Google prototype Android phone. It was only after the iPhone came out, that Touch ever entered their minds.



  • Reply 13 of 138
    gongon Posts: 2,437member
    Quote:
    Originally Posted by Apple ][ View Post


    And that is one of the main reasons why every Android device has sucked so far. Some pathetic people even go as far as denying that there is any lag on Android. They're either serial liars or they're blind.



    Plenty of people (I wager also on this forum) play console games which are fixed to 30FPS, like that Android photo gallery mentioned in the original post, and seem happy even if they have previously owned a proper gaming PC which did solid 60FPS. Then there are Mac owners who watch 24p movies on a 60Hz screen which causes a stutter of similar magnitude once a second. Are all of these people serial liars or blind if they say they don't have a problem?

    Quote:

    On a touch screen device, all user interaction needs to be instantaneous, not seconds after you press something. And everything needs to be smooth, not jerky.



    Article said nothing about seconds. Hyperbole?
  • Reply 14 of 138
    Quote:
    Originally Posted by Apple ][ View Post


    Android was made for these kind of phones. This is a Google prototype Android phone. It was only after the iPhone came out, that Touch ever entered their minds.







    Silly comment.



    First of all, that is a HTC Android prototype, not a Google prototype. Secondly, Android is software. If software wasn't scalable and able to be used on different form factors iOS (which is derived from OSX) would not exist as it does today.



    The earliest Android SDK and prototypes were designed for touch and physical interfaces and Android as it is today is fully usable using a dpad and hardware keyboard.
  • Reply 15 of 138
    Quote:
    Originally Posted by alandail View Post


    Funny out pre iPhone is used as a distinction when the iPhone is OS X, which is NeXTStep, which was designed in the 80s.



    Certainly Apple designed Cocoa Touch specifically for the iPhone, but much of what is discussed here (i.e. caching object bitmaps) are things NeXTStep 1.0 did correctly. Which enabled things like live scrolling, live window movement, etc on the desktop with the same fluidity as the UI on iOS devices.



    Correct. Then again the caliber of talent at NeXT that later became infused at Apple is head and shoulders above Microsoft, RIM, Google and the rest.



    Us former NeXT/Apple Engineers were always called snobs back when NeXT was doing stuff the rest of the industry called 10 years ahead and thus too far ahead for the general consumer.



    These companies will not catch up. The fundamental design patterns, the design decisions with the kernel, to the mach runtime, to the happy marriage of C/C99/ObjC2.0 and even C++ with Clang [and it's compiler design has Google, RIM, ARM, Intel, IBM, Cray, AMD, Adobe, Borland and everyone else getting involved to start using it] makes it clear the teams built from this NeXT foundation continue to evolve and flourish with this latest generational talents coming from around the globe.
  • Reply 16 of 138
    notrsnotrs Posts: 46member
    Quote:
    Originally Posted by Apple ][ View Post


    Android was made for these kind of phones. This is a Google prototype Android phone. It was only after the iPhone came out, that Touch ever entered their minds.







    Were you trying to make a counterpoint? Or agree with me?
  • Reply 17 of 138
    apple ][apple ][ Posts: 9,233member
    Quote:
    Originally Posted by Gon View Post


    Plenty of people (I wager also on this forum) play console games which are fixed to 30FPS, like that Android photo gallery mentioned in the original post, and seem happy even if they have previously owned a proper gaming PC which did solid 60FPS. Then there are Mac owners who watch 24p movies on a 60Hz screen which causes a stutter of similar magnitude once a second. Are all of these people serial liars or blind if they say they don't have a problem?

    Article said nothing about seconds. Hyperbole?



    Watching a movie or playing a game on a non-touch device is very different than actually interacting with a touch screen device. It is very frustrating and extremely noticeable when a touch screen device is laggy, jerky and unsmooth.



    Take the Kindle Fire for example. I've seen more than a few good quality videos of that in action, and if anybody denies that it is laggy, jerky, choppy and unsmooth, then they are definitely lying or they have very poor eyesight.
  • Reply 18 of 138
    apple ][apple ][ Posts: 9,233member
    Quote:
    Originally Posted by NotRs View Post


    Were you trying to make a counterpoint? Or agree with me?



    I agree with what you wrote, but I also think that it's pretty much impossible for them to have gotten it right on the first try, as they both basically copied whatever Apple came out with.
  • Reply 19 of 138
    apple ][apple ][ Posts: 9,233member
    Quote:
    Originally Posted by GalaxyTab View Post


    If software wasn't scalable and able to be used on different form factors iOS (which is derived from OSX) would not exist as it does today.



    I know that iOS is derived from OSX, that's what makes iOS so good. It has a great foundation. The same cannot be said for Android.
  • Reply 20 of 138
    If you take the link in the AI article, you'll see that intern Munn was responding to a post by an Android engineer, Dianne Hackborn. She described a lot of issues related to the implementation of hardware acceleration in Android past and present. It's a good thing to read before commenting on this article as it seems to be fact-laden and free of bias, pointing out both the shortcomings and the progress in that area.



    https://plus.google.com/105051985738...ts/2FXDCz8x93s



    Quote:
    Originally Posted by Apple ][ View Post


    On a touch screen device, all user interaction needs to be instantaneous, not seconds after you press something. And everything needs to be smooth, not jerky.



    There's also another big thing that Android can not do well, it doesn't handle audio properly, and realtime music apps is something else that doesn't exist on Android, because of the terrible latency.



    And with regards to you Apple ][, I love my Apple products as much as the next guy, but your comments really make me sick. You look utterly ignorant in about half of your posts. Sure, you're totally anonymous here on the internet, but have a little respect for yourself.
Sign In or Register to comment.