Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Java
Expertise: Advanced
May 5, 2009

Avoid Object Instantiation Within Loops

Avoid defining new objects within loop structures. Doing so hampers performance significantly, due to object creation overhead.

Instead, define objects outside the loop and then use them inside the loop. Moving object definitions out of your loops can often improve loop performance by nearly 100 percent.

If you want to see the actual effect, try using a profiler plugin such as jprobe or the Eclipse Test & Performance Tools Platform (TPTP) profiling tool.

Kulkarni Vasudeva
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap