This article describes how to find common programming mistakes that may lead to poor startup time and how to correct them. Included is a case study demonstrating how the Runtime Spy was used to improve the startup performance of IBM WebSphere Studio Application Developer. The previous article, Part 1, introduces the Runtime Spy.
One thing that is many times over looked is creating an object when it is not needed yet. The prefect example is creating an public/private class object and not using it in the constructor.
e.g.
public class Example {
public ObjectX obj = new ObjectX();
public Example() {}
}
The problem with this is that you are wasting the time to create ObjectX when it is not used. The correct way (more efficient way) is to do the following:
public class Example {
public ObjectX obj;
public Example() {}
}
This is extemely important when using SWING/AWT. Creating a ton of JPanel etc when they are not needed at that particular time kills startup time and redraws repsonsiveness.
I doubt your java 101 examples have any influence on people that are core eclipse developers or eclipse plugin developers in general. I’m sure these people are well aware of not creating objects until they are needed. By the way, eclipse doesn’t even use Swing. It uses SWT.
What about compiling Eclipse with gcj ? How much will the gain
be ? Somewhere I noticed Red Hat shipping a gcj compiled Eclipse, anyone tried it ?