-
Bug
-
Resolution: Won't Fix
-
P4
-
5.0
-
x86
-
windows_nt
In a recent startup performance analysis, the initialization of the
rendering infrastructure for Java2D appeared to take up a large percentage
(about 13%) of the overall startup time for a simple AWT app. This time
was spent setting up various elements of the Java2D rendering engine,
such as:
- registering native loops
- registering Java loops
- creating SurfaceData and SurfaceType structures
- creating various PixelFor classes
- setting up default loops and pipes
If we can reduce this time, it could have a large impact on overall startup time for all applications.
Here is the simple AWT app for testing:
------- StartupTest.java --------
import java.awt.Frame;
import java.awt.Graphics;
import javax.swing.JFrame;
public class StartupTest {
public static void main(String args[]) {
for (int i = 0; i < args.length; ++i) {
if (args[i].equals("-awt")) {
Frame f = new AwtFrame();
f.setSize(300, 300);
f.setVisible(true);
} else if (args[i].equals("-swing")) {
JFrame f = new SwingFrame();
f.setSize(300, 300);
f.setVisible(true);
}
}
}
}
class AwtFrame extends Frame {
public void paint(Graphics g) {
System.exit(0);
}
}
class SwingFrame extends JFrame {
public void paint(Graphics g) {
System.exit(0);
}
}
rendering infrastructure for Java2D appeared to take up a large percentage
(about 13%) of the overall startup time for a simple AWT app. This time
was spent setting up various elements of the Java2D rendering engine,
such as:
- registering native loops
- registering Java loops
- creating SurfaceData and SurfaceType structures
- creating various PixelFor classes
- setting up default loops and pipes
If we can reduce this time, it could have a large impact on overall startup time for all applications.
Here is the simple AWT app for testing:
------- StartupTest.java --------
import java.awt.Frame;
import java.awt.Graphics;
import javax.swing.JFrame;
public class StartupTest {
public static void main(String args[]) {
for (int i = 0; i < args.length; ++i) {
if (args[i].equals("-awt")) {
Frame f = new AwtFrame();
f.setSize(300, 300);
f.setVisible(true);
} else if (args[i].equals("-swing")) {
JFrame f = new SwingFrame();
f.setSize(300, 300);
f.setVisible(true);
}
}
}
}
class AwtFrame extends Frame {
public void paint(Graphics g) {
System.exit(0);
}
}
class SwingFrame extends JFrame {
public void paint(Graphics g) {
System.exit(0);
}
}
- relates to
-
JDK-4990399 JDWP: JFrame construction performance regression over 1.4.2 (method entry err?)
- Closed
-
JDK-4906307 Performance of launching demos with -server -Xcomp is much slower in tiger
- Closed