Graphic stuttering - an interesting article

Monkey Targets Forums/Android/Graphic stuttering - an interesting article

Xaron(Posted 2011) [#1]
I've found an interesting article why especially Android has so many UI problems:

https://plus.google.com/105051985738280261832/posts/2FXDCz8x93s


AdamRedwoods(Posted 2011) [#2]
Note sure if adding the gl.glFinish() works (see bottom):
http://www.monkeycoder.co.nz/Community/posts.php?topic=1897


Grover(Posted 2012) [#3]
Xaron: Would recommend taking this article with a pile of salt. The author for some reason doesn't properly understand the basic rendering of the OS, which is not how it is described. All OS's (even from back in Amiga days) use dirty rectangle rendering for their updates. They do not composite windows as suggested, because (as noted) it would take copious amounts of mem and performance. Instead, objects are batched in little cached objects and updated "portions" of the screen that dynamically change (this is rule 101 of any coding anyway - only update what you need to, not everything all the time).

So.. when writing apps - Id definitely recommend similar rendering methodologies. These were developed way back in the 70's with PHIGS :) You can gain massive performance improvements using very simple rectangle caching/dirty flag tracking.

Additionally the main issue with the whole Android v IOS performance is like comparing a Porsche with every other common sedan that comes from Japan. You will find some sedans perform really well against it, and others will be crap. This is what happens when you have fixed hw platforms versus variable hw platforms. Does anyone remember what platform won with PC vs Amiga?

The big disadvantages of fixed hw is the slow time to market. In comparison to variable, which is usually multiple times quicker at market changes. To explain - look at the last 5 years of development of IOS vs last 5 yrs development of Android (erg.. well.. u see the point). The rapidity of Android dev, and its hw.. will simply 'out cycle' the Apple hardware. It will take a decade to see the results (the Amiga took 12 yrs to be truly superseeded) .. but none-the-less it will happen. The only thing that can change that, is if Apple take a more open stance to development and hardware - very unlikely.

Cheers,
Dave


Xaron(Posted 2012) [#4]
Dave I understood it that way the OS in iPhones and Windows phones just give the UI process 100% and stop everything else, which gives the user an immediate feedback and just natural feeling.

Not so on Android where the UI process in one of many other. So you don't have that good feeling there because sometimes it reacts fast, sometimes not which is a horrible user experience.


Grover(Posted 2012) [#5]
Hi Xaron,
In Windows its event driven, so the UI doesnt really get 100% :) Thats why you can make an app (background or foreground) kill the UI (stupid while loops :) ). Also if you run Win processes in "RealTime" mode, it can turn your UI to mud.. but few apps use Realtime (sadly some of our sims do). I must admit though the new Win8 and even Win7 (to a certain degree) schedulers with their 'user mode' and 'kernel mode' like the linux guys have had for a long time, has really helped improve UI responsiveness.

IOS works on top of BSD, which is basically the same as above. But they do some neat tricks to keep mouse and 'clicking' always high priority. And you are right that is why it feels so much smoother, because the UI always _responds_. It just has a better process scheduler than Andriod (in the long run). But the real bonus of IOS is because the hw is fixed, it can allocate an _exact_ amount of time for UI. Whereas Android has to live with hardware that goes fast, and hw that runs like a dog so it cant easily force a UI schedule that makes good sense all the time - this is where higher res, background apps, etc impact the scheduling of normal processes. And thus general UI interactivity. Dont worry though.. this will disappear as hardware goes more and more multi-core for phones.

A classic similar example to IOS is Xbox360 and PS3. The system kernels on both machines reserve a complete process pipeline for UI/Background tasks. This way, even if a game or app fails, the OS can deal with it (most of the time :) ).. this is what Win7 and Win8 are now doing much better too. Win8 in fact is really quite impressive, with the high level interpreted code it will be interesting to see it on real live embedded hw.