Inconsistent Android Performance - android

I'm currently running two emulators on two different computers. Both emulators are running the same application.
Specs for Computer A:
Processor - Intel Core i5 3230M CPU # 2.60 GHz
RAM - 6.00 GB (5.89 GB)
System - 64 bit
This computer runs two servers EasyPHP, Openfire, and a web browser.
Specs for Computer B:
Processor - Intel Core i5 2320M CPU # 3.00 GHz
RAM - 6.00 GB (5.89 GB)
System - 64 bit
This computer does not run much, other than android studio and the emulator.
Computer A is extremely laggy and experiences high values of
Skipped 516 frames! The application may be doing too much work on its main thread.
Computer B on the other hand not only boots the emulator faster but the application performances smoothly. Computers B application has more View objects than Computer As. I have tried using TraceView, but the output does not give me anything useful concerning the application. It mostly outs long run time for O.S functions such as Android.os.MessageQueue.nativepollOnce, Android.view.ThreadedRenderer and the like.
If the problem is a code and or view issue then why is Computer B not experiencing poor performance? Is there another way, other than TraceView/sysTrace, that measures code performance? Does using AsyncTask hurt performance more than a normal thread does? (I've been hesitant on using normal threads due to manual thread management)

Related

Hardware upgrade for developing android App on Android studio

Hello all and thanks to answering my questions...
I am going to enter Android development eco system and i think that my PC is low end and i want to buy a new one.
Please Tell me do i need to upgrade it??? iF yes, which config i have wroten is needed?? Note that i want to buy new system and not upgrade it for years...
It's True that more Powerful system is better, but insert budget in your opinion.
at first, My PC specification for now is:
Mainboard: Gigabyte p3A
Processor: Intel e5300 dual core # 2.6Ghz ( Processor don't support HAXM that indeed for Android Studio)
Memory: 2+1GB # 333 Mhz
Old HDD drive with 250 GB capacity
So i writen spec of two pc:
1. PC config 1:
Mainboard: Asus H81M-c
Processor: Intel Core i-3-4170 (Amazing !5300 passmark benchmark)
Memory: 2x4GB #1600Mhz CL7
SSD Drive: Samsung 850 evo 120 GB
2. PC config 2:
Mainboard: Asus H97 Plus
Processor: Intel Core i7-4690 (Amazing 10500 passmark benchmark)
Memory: 2x4GB #1600Mhz CL7
SSD Drive: Samsung 850 evo 120 GB
First off, yes I'd say you should upgrade it. Do you need the upgrade? Well, in my personal experience, you don't absolutely need to upgrade. I created my first app on an ancient 8 year old PC, with 1GB RAM, 3.2Ghz Pentium 4 and onboard Intel graphics running Ubuntu 13.04
Now, my app was a simple one, yet Android Studio took about 3-4 minutes just to compile it. On a modern PC, it would take just 20-30 seconds. So no, its not very easy or smooth, but it at least works.
Now as to your situation. You happen to have a very outdated PC. So, I'd strongly recommend upgrading, for a much smoother experience. Android Studio recommends us to have at least 8GB RAM and some decent processor.
Between the PC config 1 and config 2, they are all the same, just different processors and motherboards. I'd say you should go woth i7 because its more advanced and probably performs better too (check some benchmarks for that, your benchmarks aren't clear enough).
The SSD is a good choice, as it would improve build times.
I also recommend increasing the RAM, to 12GB if you can afford it.
On the Graphics front, you haven't mentioned any specific Graphics chip. Don't go with any onboard graphics though, because you really need some decent graphics card. And who knows, you may want to make games some day. So, buy any decent NVIDIA or Radeon graphics card that you can afford.
And yup, that's it. Its my opinion on the kind of machine you should have. But, this kind of thing is rather subjective, so get all the counsels you can get, and then decide for yourself.

Is the processing time on emulator more than than on a real device?(android, eclipse)

I am making an android app. When I run it on the emulator, which has 512 MiB RAM, a simple activity takes 3 seconds to complete. Will this time be lower on a real device, as 3 seconds is inacceptably long! If it will be lower then by what factor( an estimate will do)? Thanks.
It really depends on exactly what you're doing, but as a rule of the thumb, devices are much faster than emulators.
Emulators are slow because an entire ARM process architecture is emulated through software, which adds a (big) extra layer between the Android system and your computer's processor.
Trying using one of the x86 intel images for a faster emulator closer to device speeds.
However, no emulator will give you the same speed as a device.

How cpu and memory intensive is android development?

I've been programming for about two years (android and java for a few months), but I still don't really know what impact the processor (speed and cores) and the amount of RAM has on the "programming experience" (compilation time, responsiveness of tools, overall workflow, etc.).
(If I'm allowed) to be specific (otherwise ignore): I'm about to buy a 13" MacBook Pro and try to decide between the i5 (2,5 GHz Dual-Core) and the i7 (2,9 GHz Dual-Core) and find this hard.
I don't program in Android that often, or even use Eclipse regularly, but I know that in my old 1GB laptop, Eclipse takes forever to load and is very sluggish, while it loads pretty much almost instantly with my new 8GB, is almost flawlessly smooth. But the only difference in the two laptops are not just the RAM or the CPU though, the old laptop is spinning a 5400rpm disk platter while my new one uses solid chips.
Specifically with Android development though, you will be running the emulator and probably multiple instances of the emulator at the same time. These emulators are pretty memory hungry, and Eclipse aren't lightweight by any measures either. You never ever want swapping, swapping is only there for so the system doesn't start killing processes if it ever runs out of memory, but you don't want it to ever be filled with anything with day-to-day usage. If your system starts swapping, that's the sign that it's severely need more RAM.
In my personal experience, larger and faster RAMs generally contribute to responsiveness better than faster CPUs (though you still need to get at least a mid-range CPU); compilation is usually I/O bound (although this might be different depending on the codebase) so it's best if the OS can keep all the files you're currently working with in disk cache in the RAM, and for loading times you want a fast harddrive (or even better, an SSD; because fast harddrive is much noisier, much more vibrations, and battery hogs, which is sometimes acceptable for a desktop tower below your desk but not for laptop).
Another important consideration is power-saving features in the CPU and battery life if you're going to be using it on the way; the weight, the screen and keyboard size, the "feel" of the touchpad (is it too slippery, or too rough, etc; once you get used to it, touchpad is much faster and comfortable than the mouse since it's much closer to the keyboard). Don't just compare the numbers.
I have three development computers. One Dell Latitude with i7, 8GB ram and a SSD with Windows 7. The other is a 17' i7, 8GB ram, SSD Macbook Pro with OS X.
The last one is a old HP small form factor, Core2Duo, 2GB ram and a slow HDD.
All three are fine for Eclipse, and NONE will run the emulator as fast as I want to. The emulator is sluggish, even on a $3000 laptop - the difference between i5 and i7 won't be that huge.
If I were you, I would opt for the cheaper one of them, and invest in a decent Android phone for running the software.

why android emulators are very slow on my computer [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Slow Android emulator
is it my computer's hardware limitation? it has 1024 megabytes of ram 2200 x 2 dual core amd cpu i can't develop any android. the emulators are heavy what can I do? i download old sdk and newer ones but it still the same.
You could try using the x86 (Atom) system image it's faster than the arm images
See this link for more info
I have much better PC than you and even I have difficulties with emulating some OpenGL ES applications that I develop for android.
You must understand that emulating a CPU which is different than current architecture is very hard to do and as such very hard to do very optimized. Running machine code for ARM on x86 must bring some delays in running it. Conversion and repacking back and forth.
I would rather try to use your own Android device for testing and debuging purposes instead of emulator. It runs in real time and it will be better for you if you don't want to upgrade your CPU and RAM.
1 gigabyte of ram isn't enough. Eclipse alone would take up almost a two-thirds of that
(mine takes up 900mb - tweaked in eclipse.ini), and a 2.2 Emulator on HomeScreen would take up about 200mb. Unless you don't open anything else while coding - firefox, chrome (that ram sucker of a browser), mail client, chat client, etc., you're only a pinch below the limit.
The best you can do outside of upgrading memory is to run emulator in QVGA (in AVD Manager, click on your virtual device, click edit, under Skin, change Built-in to QVGA. But it would only do so much - you need at least 4 gig to go smoothly with all other apps open.

Performance of app on Android Phone Emulator vs Actual Device?

I am working on a compute intensive app for Android. I do not have any device yet to test performance. However, the performance on emulator is a bit slower than expected.
I see an old question about some estimation of emulator vs device. What are your experiences while developing apps with recent SDK Froyo/2.2. Is performance observed on emulator is slower than actual device.
Please share your experience and the specs of your dev machine and mobile devices, both.
Note: To get virtual device's CPU speed one can run cat /proc/cpuinfo from adb shell. How is this comparable to actual device's CPU frequency?
Processor : ARM926EJ-S rev 5 (v5l)
BogoMIPS : 240.02
From a CPU standpoint, the emulator tends to be slower than actual hardware, presumably due to the overhead of converting ARM bytecodes to x86 ones on the fly.
From a graphics standpoint, the emulator tends to be dramatically slower than actual hardware, because the emulator lacks hardware graphics acceleration (regardless of the quality of the host computer's video card).
From a disk I/O standpoint, the emulator tends to be faster than actual hardware, particularly on write operations. Flash writes can be very slow, depending on a wide range of criteria (wear leveling, percentage of the flash storage that is in use, etc.). Brad Fitzpatrick covered this topic in his Writing zippy Android applications presentation at the 2010 Google I|O conference.
From a network standpoint, the emulator can be faster than actual hardware, because WiFi or wired Ethernet hooked up to broadband will typically be faster than a mobile data connection.
Yes true the emulator is slower than a real device. I have quite a decent development computer and it still is slower.
Here are my specs.
CPU: AMD Phenom X4 940BE (3GHz)
RAM: 8GB Corsair (800MHz)
GFX: Nvidia 9800 GTX+
MBD: Asus M3A78T
HDD: WesternDigital Velociraptor SATA2 (10k RPM)
OS: Ubuntu Lucid Lynx 64bit
And still it is quite slow compared to a real device.
Quick answer. I have found the emulator to be slower than real devices, even on my relatively fast PC.
if you install a SSD (solid State Drive) that will help a lot. i can see that you cpu and ram are decent but the simulator is pretty heavy (lots of rendering .. etc) and a faster Disk can be very helpful.

Categories

Resources