How to detect bottlenecks in the code to optimize it
Article Metadata
If you need to optimize a Java ME game or application and you don't know where to optimize, you should use a Profiler as the ones in SDKs and you should try to take times over your code.
If you want to know how many milliseconds an algorithm takes to finish the task in one device, you should use this code:


Its really good information. Many Developers develops many application but when it will be actually runs on consumer mobile it differs from device to device. So to optimize best performance out of your application this article has given best and easy way.
Just simply record the time at the start and end of every classes and methods. After that store the difference in duration object. By accessing duration object one can know the time differences amongst different methods and classes can correct the appropriate code to make the duration as low as possible to increase the performance.
This article has indicated great way to optimize the application in simple and sophisticated manner.
--kalki 19:22, 14 September 2009 (UTC)