We have a article on native methods . You will get the speed of C, but loose portability. For example, if you try to handle an exception that may occur only one time in a loop, rewrite your code. Then, this StringBuffer object is converted into a String. The difference may be significant within a loop.
Synchronization Avoid the use of synchronized methods.
Picking the whole method is he simplest to use. Anyway, It is very inefficient to hold the lock for the section of code where it is actually not needed. Synchronizing a class because it may be used by multiple thread is also inefficient. It takes some time to get the lock. Garbage collection You can improve performance of your Java applications by not creating excess objects to be garbage collected.