My application takes several seconds to show the first window with a Canvas3D in it. I’ve profiled it and found that the bottleneck is in SimpleUniverse.getPreferredConfiguration(); the first call takes three or four seconds, and it must be called before the scene can be rendered.
I’m using the Direct3D renderer (-Dj3d.rend=d3d), because the OpenGL renderer crashes on my graphics card. I have an integrated ATI card running a single monitor.
The reason for the slowdown is that
GraphicsDevice.getConfigurations(), which is used bySimpleUniverse.getPreferredConfiguration(), is very slow on some systems. See this java.net forum thread, which links to this Java3D bug, which in turn links to this Sun bug:The workaround mentioned is to pass
-Dsun.awt.nopixfmt=trueto the JVM, which makes the underlying native code not callDescribePixelFormat.This apparently is not a perfect solution:
But since I was using Direct3D anyway, it’s not a problem. This cut 3.2 seconds off of the startup time.