Reputation: 1867
How can I test an application for performance in Android? What is the support provided in Android and how do I use it?
Upvotes: 75
Views: 51016
Reputation: 3
you can use load runner.,
use this link to find more about it.,
Steps to be followed are:
Now you can perform your test.,
Upvotes: 0
Reputation: 193794
If you want to profile your application to find performance bottlenecks you can use the traceview
tool. This gives you a graphical view of performance traces of your application.
To create a trace add the following to your code where you want to start tracing:
Debug.startMethodTracing("myapp");
and then put the following when you want to stop tracing:
Debug.stopMethodTracing();
This will create a trace file call myapp.trace
in the root directory of the SD Card. As it is written to the SD Card:
You'll need to give you app permission to write the SD card by adding the following to your Manifest:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
Once the file has been created you'll need to copy it to your PC. You can do this using the adb
command:
adb pull /sdcard/myapp.trace c:/my/dir/myapp.trace
Finally, start traceview
giving it the full path to the trace file:
traceview c:/my/dir/myapp.trace
I did have some problems with traceview
failing with OutOfMemory
exceptions. I fixed this on Windows by changing the last line of traceview.bat
from:
call java -Djava.ext.dirs=%javaextdirs% -Dcom.android.traceview.toolsdir= -jar %jarpath% %*
to:
call java -Xmx1g -Djava.ext.dirs=%javaextdirs% -Dcom.android.traceview.toolsdir= -jar %jarpath% %*
Adding the -Xmx1g
option allows traceview
to use more memory.
Upvotes: 97
Reputation: 3
Another way to test is Using TruClient on Load Runner
Steps to be followed for Mobile Web are:
Steps to be followed for Native Mobile are:
you can record the scripts and perform your testing....
Upvotes: 0
Reputation: 1396
I think traceView contains too much information, you can easily get lost.
My solution is just log the system time at three place in the code.
Before and after and center at the potiential slow code.
like binary search, next time, narrow it down step by step, then finally find the culprit code.
Upvotes: 3
Reputation: 36484
Also, theoretically, DDMS can get memory allocations for your program and then you can analyze the dump using profilers.
DDMS Reference.
The reason why I have theoretically in italics is that I myself have not tried doing anything such, yet.
Upvotes: 6