sat
October 8th, 1999, 07:13 AM
Where shall i get the programming tips to increase the performance of the Java Program.
thanx
regards
sat
thanx
regards
sat
|
Click to See Complete Forum and Search --> : performance sat October 8th, 1999, 07:13 AM Where shall i get the programming tips to increase the performance of the Java Program. thanx regards sat unicman October 10th, 1999, 12:51 PM I don't know exactly where u would get tips for making prog efficient. And if u find it I will be interested in it also! I have some points which may increase performance of java program a bit... 1. Always use 'System.arraycopy' for array transfer 2. Keep no of threads to min (its easy in java to create threads so its a tendancy to keep multiple threads thinking the performance will be better, but if there are too many threads they eat up time in switching that doing processing!) 3. Remove debug code when creating realease build. I had learnt a method from a source code. The guy had 'DEBUG' flag in each class and was enclosing all debug code (prints etc) in 'if(DEBUG)' statement. So with a change of flag, all the debug code will can be eliminated. 4. Do not create unnecessary objects in memory. It is a habit to do... class Test MyClass rr = new MyClass();// This could have been initialized to null. public Test( ) { rr = new MyClass( 'diff param' ); } } 5. Use 'arrays' instead of vectors. Vectors may reserve extra memory for accomodating new elements. If u know that no of elements aren't changing that frequently it may be a better idea to keep it a array. 6. Performance of software may drastically increase if the methods which are used quite frequently are optimised. There may still be additional tips depending on in which area the application is developed. Means in graphics... 1. The painting should be minimum, so as far as possible keep swing components transparent. So time of repainting its background won't be there. - UnicMan http://members.tripod.com/unicman codeguru.com
Copyright Internet.com Inc., All Rights Reserved. |