Android web UI Performance is dramatically slower than iOS (why?) - android

I wanted to test android for a html5/Javascript web app, so I purchased a Nexus 7 (2nd gen), and upgraded the OS to the lastest 4.3.
The Nexus has substantially better specifications than my old test iPad 2:
2GB ram vs 512MB
1.5GHz x 4cores vs 1GHz x 2cores
However I'm finding the Nexus UI interaction on web pages is between ~5-10 times slower than the iPad. Button presses, animations and the like are very laggy. For example a button press flipping from pressed to unpressed on the iPad 2 keeps pace with as fast as your finger can twitch, even when drumming two fingers, (greater than 5/sec). Whereas the Nexus is noticeably lagging behind the user touch at less than 1/sec. In fact Android/Nexus is so slow it sometimes misses the un-touch event, leaving the button in the depressed state.
I am trying to get the the bottom of this, is it a limitation in the OS? A problem with the hardware? (this is googles own device though) Is the Java JVM overhead limiting performance? (though I'd think that Chrome is all native C/C++). Is there a fix?
I ran an Browser javascript test (Dromaeo), and the computational results are what you'd expect (the newer fast Nexus was around 2x the speed of the old iPad). Though I did notice that oddly the iPad out-performed the nexus in DOM manipulation tests by around 2x, though still not as dramatic as in the user experience.
Any thoughts?

Related

KineticJS gives 2fps drag performance on Android mobile VS 20fps Android desktop

Very slow interactive drag performance (about 2 fps) while running a simple KineticJS version 5.0.2 app on Android Chrome (Android 4.3 on a Samsung Galaxy Note 10.1 2014 edition) BUT as soon as I select Chrome's setting to "Request desktop site" suddenly there's a massive performance increase of about 10x with the drag refresh rate. I'm not sure if this is a KineticJS issue or perhaps something else entirely. Running on a desktop browser on my workstation, performance is butter smooth.
Here's a description of the app: There's a bitmap in the background layer (900x600) and a PNG bitmap with alpha channel in the foreground layer (320x156) with draggable = true.
If I remove the background layer, then drag performance is OK.
Is there a way to solve this?
I have now achieved a consistent frame rate of roughly 30 to 40 fps on both mobile and desktop modes on the Samsung tablet mentioned above!
The big change came from restructuring my game code which erroneously called init() several times (about 6 times) instead of just once, each time instantiating the stage and the multiple images. I do also use "Kinetic.pixelRatio = 1" at the top of the code and a "Kinetic.FastLayer()" for my static background artwork.

Trivial Haxe (HaxePunk) game runs far too slow on HTC Desire (Icecream Sandwich)

I've made a simple, 3 frame, animation of a character walking to wherever you click on screen using Haxe+ Haxepunk... Well I copy/pasted code from online tutorials just to test Haxe out.
This runs great in flash, iOS simulator and on a Samsung Galaxy 3... But on my HTC desire it runs at less than 1 frame per second. While I know the desire is no spring chicken this is a massive performance gap, more so than I've seen on any app re: Galaxy vs. Desire...
Is this a Haxe problem or something I have done wrong (wrong NDK, wrong compile flags, OS too old, etc)?
Go into Engine.hx, the render() function, and comment out HXP.screen.refresh(). This line is absolutely killing performance on OUYA (an android gaming console) so it might be killing you too. Since you're not clearing the screen every frame anymore you'll want to draw a background every update by adding a Backdrop instance to your world. My game goes from 7 fps to 52 fps with these changes alone at 1080p resolution and ~80 entities.
Also try grabbing the latest HaxePunk from github and running ant to install it, the devs have been working on android performance lately and there's some good unreleased fixes which will be cream on top of the above fix.

Galaxy 10.1 runs app slower than Thunderbolt

So I recently created a game with several activities. On my HTC Thunderbolt, all parts of the game seem to be running very fast; however, on my Galaxy 10.1, two of my five activities are running extremely slow (i.e. screen fading is slow, enemies and cursor are moving slow as well). I don't know what is wrong. The other activities are running at or at least near the speed my thunderbolt was running at. Can someone please help me?
Try enabling hardware accelerated graphics, which is available on Android 3.0+.
Or, if you are serious about game performance, use OpenGL instead.

Samsung Galaxy Tab produces jerky animations at the start of the game

First to thank you all for your great help, I have finally published my game puzzle, both full and free version. Not sure how would I do it without Stackoverflow.
I also learned a lot by helping others.
The issue I am having is that when I start applications I have developed, on Samsung Galaxy Tab, animations are jerky at first 10 seconds or so, then they become smooth. This is not the case on HTC desire or Samsung Europe mobile.
It does not matter whether the animation is a frame by frame canvas drawing or built in android view animations.
I wonder if there is something I can do to prevent this slow down; is it something to do the way Galaxy Tab buffers when loading an application and optimising the resources? Or is this to do with the fact that it has a higher resolution screen… or both.
One way to deal with this could be to create some kind of animated intro in the same activity which would preload/optimise Galaxy Tab for the game.
EDIT after few months of development:
When testing an app on Galaxy Tab it starts slow and the animation is jerky, but if I restart the app and/or unplug the USB link, then it run fast as it should.
It's hard to say without seeing any of you're code. I couldn't say if it's a general problem with your code that only becomes apparent on slower devices, or if it is actually an issue with the Tab.
When testing my applications on the Galaxy Tab the general user interface is slower than on a Galaxy S (2.2), Nexus S or HTC Hero (2.1) but there are reasons for this:
Nexus S has a better GPU and Android version
Samsung have enabled some hardware-acceleration wizardry in their later Galaxy S builds
The resolution of the Galaxy Tab is higher
My main experience has been that the effect of the garbage collector (GC) is much more prominent on the Tab, therefore it could be something to do with your memory management -- are you creating objects in your onDraw method?

Android: performance increase of the app after 15s-120s. Why?

I have a bit of a problem with a game I am working on. The game runs very well on most devices, except Samsung Tab and Galaxy S (it could be more, but I have reports about those two).
What happens on those devices is that the app appear extremely sluggish for 15s-120s then speeds up dramatically (from 5fs to 30fps, which is the normal performance elsewhere). This seems to happen only when the game is installed (or reinstalled).
What could cause that problem?
On the first run, we create a couple of files on the SD card to store settings, but I doubt that could have a lasting effect?
The JIT takes a whiles to kick in? But it runs perfectly fine on other platform with and without the JIT. Admitedly, by disabling the JIT, it appears that the slowdown will last longer on the Tab, so there may be an effect.
Could it be that the device tries to rearrange out the objects are laid out in memory? The game does take quite a bit of space in memory.
Is there any known problem with Samsung devices? (It appears to be a problem on those only)
Any help is welcome.
You could try to call dalvik.system.VMRuntime.getRuntime().setMinimumHeapSize() early in your app with about the size of the heap while your game runs. This will allocate the target heap size at once and avoid reallocs.
I know it is deprecated but who cares if it helps.

Categories

Resources