View Single Post
  #23 (permalink)  
Old 03-28-2008, 05:14 AM
amansundar amansundar is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 324
amansundar is on a distinguished road
Default Re: Android Tips and tricks

Use Native Methods

When processing strings, don't hesitate to use specialty methods like String.indexOf(), String.lastIndexOf(), and their cousins. These are typically implemented in C/C++ code that easily runs 10-100x faster than doing the same thing in a Java loop.

The flip side of that advice is that punching through to a native method is more expensive than calling an interpreted method. Don't use native methods for trivial computation, if you can avoid it.
__________________
cheers
Aman
Reply With Quote