开发者

Working very slow

My application connects to web server, downloads data (approximately 43000 Bytes) and do mathematics function (such as log, +, -, * etc...) on each byte.

To prepare apk file, it is just like publishing to android market. Turned off debug mode and deactivated all loggers.

Then put it to the web server and downloaded (installed) on my HTC device. After installation, I've tested the application. The time from beginning read bytes to end of task is approximately 4 minutes. It is very slow.

I've researched this part. It seems that is working slow on mathematics functions.

Is there any way to increase working speed ?

My code is same as iphone version of my application. It is very fast. All parts complete in 4 - 10 seconds.

What is wrong here ?

Or do I need to any configuration (related debug mode) ?

Ple开发者_JAVA百科ase advice.

Thanks.


I would suggest to benchmark raw math performance on both platforms.

Not all mobile CPU's have hardware FPU module, so complex math might be VERY slow.

Workaround is to implement math functions via integer calculations with limited precission - this could give you some 2-10x performance boost if it's really emulated math.


The first step in solving any performance problems is to identify them. You should profile your application to identify exactly where the problems are.

You can use the traceview tool to profile your application. Have a look at this question for instructions on how to use traceview.


Native methods using the Android NDK is an option for performance-critical code sections. It's complicated and requires careful attention to compatibility issues, but could give you the performance boost you are looking for.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜