Here is why Android is laggy and why it’s going to remain like that in the near future

Here is why Android is laggy and why it’s going to remain like that in the near future
Have you noticed that Android is laggy? It is. We hoped things would change with dual-core processors and when we got the LG Optimus 2X in our trembling hands, the first phone running on the dual-core NVIDIA Tegra 2, we nervously swiped to the homescreen, then to the main menu, then to the weather app. The lag was still there, but we couldn’t understand why - the raw hardware muscle was there already. What was wrong? Turns out, the problems is rooted deeper, in the very origins of the platform. Android's UI was laggy because it was coded differently than iOS and we’re not talking about Android’s bytecode against iOS’s native code.

Now, after Google engineer Dianne Hackborn brought up the topic of hardware graphics acceleration, Android’s lagginess has finally gotten in the limelight for some confessions which 200 million users of the platform are waiting for. Former Google intern Andrew Munn dug deep into the topic with more insights coming from Android software engineer Romain Guy who worked on Honeycomb’s full graphics acceleration and other engineers.

So with no further ado, the core reason why Android is laggy is the way it treats UI rendering. While on iOS UI rendering happens in a separate thread with real-time priority, on Android this happens in the main thread with normal priority. This of course means that other apps can take over your processor resources and hurt basic UI interactions, translating into a noticeable lag. Munn examplifies this with Safari and the Android browser - if you tap and hold into the Safari window while it’s loading a webpage, the loading process stops, as UI rendering has the highest priority and takes over. The result is that the webpage will not load until you lift your finger off, but the UI will remain buttery smooth all the time. Android has a radically different approach - it will try to maintain a reasonable response rate for the UI and load the webpage, but often the framerates would drop causing a visible lag.

“Android UI will never be completely smooth because of the design constraints I discussed at the beginning:
UI rendering occurs on the main thread of an app
UI rendering has normal priority

[…] This is the same reason why Windows Mobile 6.5, Blackberry OS, and Symbian have terrible touch screen performance. Like Android, they were not designed to prioritize UI rendering. Since the iPhone’s release, RIM, Microsoft, and Nokia have abandoned their mobile OS’s and started from scratch. Android is the only mobile OS left that existed pre-iPhone,” Munn says.

Now, that’s a tradeoff that doesn’t seem acceptable for touchscreen smartphones. Interestingly, with dual-core processors, this is less noticeable, but an occasional hiccup still occurs more often than the user would like to see it. Hardware graphics acceleration alleviates the problem, but that’s where one of the most popular dual-core chips, the Tegra 2, however, falls a bit short as it has a low memory bandwidth and doesn’t support NEON for faster matrix math, so other chips like the Exynos one yield better performance.

We won’t spoil the fun of reading the whole article, but we’d summarize the core reasons for the laggy UI in Android. The lack of full hardware graphics acceleration until Honeycomb for tablets and ICS for phones, the imperfect garbage collection in Dalvik, inefficient UI compositing, and finally Dalvik itself as a virtual machine are all partly to blame.

But most importantly, unless Google changes the way UI rendering happens (to a separate thread) and its priority (to real-time), the issue of some lag on Android will likely persist. Why is this hard to do and what would change if it did happen? Hit the source link for a very interesting read.


FEATURED VIDEO

317 Comments

1. taz89

Posts: 2014; Member since: May 03, 2011

my exynos gs2 is lagless so this is not completely true

10. XiphiasGladius

Posts: 813; Member since: Aug 21, 2011

Amen!

45. ardent1

Posts: 2000; Member since: Apr 16, 2011

Here's what Andrew wrote that was omitted: "Work on Android started before the release of the iPhone, and at the time Android was designed to be a competitor to the Blackberry. The original Android prototype wasn’t a touch screen device. Android’s rendering trade-offs make sense for a keyboard and trackball device. When the iPhone came out, the Android team rushed to release a competitor product, but unfortunately it was too late to rewrite the UI framework." (source: A. Munn's post on Google+) Android was originally designed to compete against a BlackBerry!!!

116. Lucas777

Posts: 2137; Member since: Jan 06, 2011

um as with every other major mobile os... is this schockin news?

33. ayephoner

Posts: 858; Member since: Jun 09, 2009

the article is not based on speculation or user experience.

34. taz89

Posts: 2014; Member since: May 03, 2011

the article says that android will ALWAYS be laggy but how can that be true if the gs2 exynos models dont lag right now? gs2 proves that android can be lagless.

71. downphoenix

Posts: 3165; Member since: Jun 19, 2010

but only through very powerful hardware. And who's to say it wont lag when it gets Ice Cream Sandwich?

87. taz89

Posts: 2014; Member since: May 03, 2011

my guts says ics will be lagless on the s2...Samsung just seems to know how to make a android smooth unlike others...also with one of the best processor and the fact that ics is more energy efficient and uses hardware acceleration I see no reason for it to lag on the s2 considering gingerbread does not have hardware acceleration...also I have tried ics aplha roms on the s2 and is super smooth so I will bet that the official one will be even better

49. abdane

Posts: 507; Member since: Oct 07, 2011

my SGS2 is not laggy ! o.O

69. rendHELL

Posts: 304; Member since: Nov 09, 2011

that is So true.... go sammy!!!!....

73. shafboy

Posts: 179; Member since: Sep 26, 2010

Will it not be smooth if Android change this?

84. andro.

Posts: 1999; Member since: Sep 16, 2011

agreedmy galaxy s2 and all my friends galaxy s2 phones are lagless also. Working for a phone network i test alot of phones and i can say the galaxy nexus,htc sensations,sony arcs and many others are lagless. This article is a surprisingly poor from PA,maybe some android jealously behind it

117. Lucas777

Posts: 2137; Member since: Jan 06, 2011

live with each of them for a year and i bet you anything they will all be lagging at the end.. testing a phone for a day to see if it lags is not really a great test

194. Retro-touch unregistered

My Samsung Captivate is lagless with a custom ROM of course. Its a KK4 Samsung leaked ROM thats been tweaked but even with third party apps I'm amazed at its speed of operation. Most other ROMs have had lag in browser, for example.

111. The_Miz

Posts: 1496; Member since: Apr 06, 2011

Kinda hard to lag if your phone has no signal. ZING!

112. protozeloz

Posts: 5396; Member since: Sep 16, 2010

At least they fixed the bugs also its not all the galaxy

198. remixfa

Posts: 14605; Member since: Dec 19, 2008

did miz just make an anti-apple joke??? lol

273. hepresearch unregistered

He did, and it was hilarious!

124. 530gemini

Posts: 2198; Member since: Sep 09, 2010

@taz. I guess those google engineers don't know what they're talking about then :)

169. hepresearch unregistered

hmmmm... I guess gemini agrees with a Senior Programmer at Google when they have been discredited... even if he rips on others for agreeing with the guy... hah!

257. systamatics

Posts: 63; Member since: Nov 16, 2011

thats cause it has one of the ugliest UI in all android.

2. The_Miz

Posts: 1496; Member since: Apr 06, 2011

First. And this is why Android will always be second best - because of the lag. It makes no sense to have dual core, tegra powered phones that still have lag.

6. protozeloz

Posts: 5396; Member since: Sep 16, 2010

At least read the hole thing

11. XiphiasGladius

Posts: 813; Member since: Aug 21, 2011

First what? First troll I presume?

209. hepresearch unregistered

Indeed.

12. ledbetterp3

Posts: 467; Member since: Aug 31, 2011

You are not first, you are showing the mindlessness of iphone users... Just kidding =P, but there are many reasons why android is better than iphone other than lag, I bet a lot of people will name those for you, so I won't bother, and the reason to have dual core processors is to reduce the lag noticeably, even though it doesn't rid it completely, so it is still definitely worth having.

20. p0rkguy

Posts: 685; Member since: Nov 23, 2010

if you tap and hold into the Safari window while it’s loading a webpage, the loading process stops, as UI rendering has the highest priority and takes over. The result is that the webpage will not load until you lift your finger off, but the UI will remain buttery smooth all the time. Android has a radically different approach - it will try to maintain a reasonable response rate for the UI and load the webpage, but often the framerates would drop causing a visible lag. Sounds like a dumbphone.

315. Smokn04cobra

Posts: 22; Member since: Feb 20, 2011

Forgive me if I am not understanding the point behind this...If you are able to "tap and hold the safari window to stop the webpage from loading and allow the UI to run buttery smooth" If you are in the safari window and you stop a web page from loading then won't you be starring at a webpage that isn't loading and a screen that isn't changing so I would assume that there aren't any parts of the UI that you would be able to see run "buttery smooth".

38. arcq12

Posts: 733; Member since: Oct 13, 2011

i cant stop laughing about this bullcrap..

58. iamcc

Posts: 1319; Member since: Oct 07, 2011

Once again Miz, you love to be first even when you are second. And yes, i'm referring to you thinking the iPhone is the best as well as your pathetic need to claim "first".

* Some comments have been hidden, because they don't meet the discussions rules.

Latest Stories

This copy is for your personal, non-commercial use only. You can order presentation-ready copies for distribution to your colleagues, clients or customers at https://www.parsintl.com/phonearena or use the Reprints & Permissions tool that appears at the bottom of each web page. Visit https://www.parsintl.com/ for samples and additional information.