This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes How to optimize? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to optimize?" Watch "How to optimize?" New topic
Author

How to optimize?

Maki Jav
Ranch Hand

Joined: May 09, 2002
Posts: 435
Hi all,
I want to ask how to optimize my swing/awt application? What points to keep in mind?
My application uses JInternalFrames, connections to SimpleText database
and static loading of variables.
Thanx in advance,
Maki Jav


Help gets you when you need it!
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

Optimize for what?
For size, for speed, for usability, for extendability?
Optimisation is the source of all evil (D. Knuth [from memory]).
Mostly, optimisation is meant for speed, if not suggested otherwise.
And mostly optimisation for speed will make the programm:
- harder too read and maintain
- bigger
- harder to extend
- harder to port
Therefore optimisation for speed should be avoided if possible.
Where speed-problems encountered?
If yes, you should start with a profiler, finding the bottleneck, since often only a small amount of code is guilty for consuming much time, and only this is a candidate for optimisation.
Another answer could be: rewrite it in asm
Or implement it in hardware


http://home.arcor.de/hirnstrom/bewerbung
Nathaniel Stoddard
Ranch Hand

Joined: May 29, 2003
Posts: 1258
GUI applications are for the most-part IO-bound anyways. So, it's not like you'd be able to optimize it at all. That is unless you have some giant calculation that it actually does at some point. Thus, the profiler comment by Stefan.
The real question though is: is the program running too slow, or are you just wanting it to run faster because you can? Optimization is always in context of user needs. And therefore if the user is happy, then it is already optimized.


Nathaniel Stodard<br />SCJP, SCJD, SCWCD, SCBCD, SCDJWS, ICAD, ICSD, ICED
Maki Jav
Ranch Hand

Joined: May 09, 2002
Posts: 435
Hi,
Well! the optimization that I sought was about speed.
My program is not that slow. And database queries get you result in about 1 second (I am using SimpleText Database). The JOptionePane.showMessgae() that I am using to show property(realestate) details opens quite quickly.
I see no such problems which might upset my user. The only minor problem could be the extra black dos-prompt screen that opens when it starts.
Maki Jav
Eddie Vanda
Ranch Hand

Joined: Mar 18, 2003
Posts: 281
use "javaw" instead of "java" when you start your app


The nice thing about Standards is that there are so many to choose from!
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

Or google for 'splashscreen' and 'java'. Show a nice logo at startup.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to optimize?
 
Similar Threads
how to determine, when improvement is needed?
Networking performance questions
How to stop the memory creeping even before I test the application
How to optimize heap memory in tomcat when using JSP
Websphere 5.1 and GZIP or DEFLATE