I have been comparing a Java GUI program's start time to both native apps and another Java based app, and I have concluded that my program is launching a little too slowly, or at least a little slower than I would like. I think it's taking too long to load everything but there isn't an issue with the efficiency of the algorithms from what I can see. My thought is that I may be able to achieve this if I can find a way to increase the memory available to the JRE that is packaged with class files. Are there variables I can change like this to increase how fast the JRE or underlying hardware will run my software?

Recommended Answers

All 2 Replies

I'll share a trick I used long ago. It's very simple. In my code I present the UI first, then go on to read files, setup arrays and what not. That way the user gets the screen to see ASAP and then behind the scenes, while they ponder the first move, my app is working at getting ready.

There's not a lot you can do to speed up the loading, buut you can give the impression of a very fast startup by displaying a splash screen while your program is loading. By referencing the spash screen in your jar's manifest Java will display it immediatley, ie even before it starts to load the JVM. Once your program is loading you can draw onto the spash screen to display progress if you want.
It's all explained here...
http://docs.oracle.com/javase/tutorial/uiswing/misc/splashscreen.html

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.