J2ME program optimization skills

xiaoxiao2021-03-06  45

(1) Connect less string, multi-use StringBuffer

(2) Try to use the fixed size array instead of using the Vector

(3) If you can implement the function without using a new Class, don't add new Class because each class has certain memory overhead.

(4) Use limited object-oriented, because pure OOs often mean more imaginary methods, more levels of relationships, more CLASS

(5) Consider using public domain (ie, data members) instead of getter and setter

(6) Use Final modifiers to determine the method that does not have to be inherited

(7) Use BufferedInputStream or BufferedReader to package input streams

(8) Use the obfuscator to use the obfuscator before the release, in addition to prevent others from compiling your programs, you can reduce the size of the Class file, because the obfuscator often replaces the original variable or method with a shorter string name.

(9) instead of global variables with local variables.

(10) Only the memory is only assigned to the object, and it is set to NULL after use.

(11) Place as much as possible to execute on the server, and minimize the number of communication and transmission data of clients and servers.

(12) Do not declare into int in with Boolean solved

(13) Function for execution time More than 0.1 seconds can be put to another thread execution

转载请注明原文地址:https://www.9cbs.com/read-51830.html

New Post(0)