 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Ric Has Guest
|
Posted: Sat Jun 26, 2004 12:56 am Post subject: old app inheritance |
|
|
Hi,
I just inherited an old gui application that was implemented using AWT,
I think circa Java 1.1. It is running on a Sun-Blade 2500 running Solaris
2.9 and JRE 1.4.2, so it should be flying, but it's not. In fact, the
performance is horrible. How should I go about improving it? Do I upgrade
to JRE 1.5.0 first? Should I reimplement everything in Swing? Or do I get
a profiler, find out what the heck is killing me, and try to improve it?
ANY suggestion would be helpful. Thanks!
Ric
|
|
| Back to top |
|
 |
Raymond DeCampo Guest
|
Posted: Sat Jun 26, 2004 5:39 pm Post subject: Re: old app inheritance |
|
|
Ric Has wrote:
| Quote: | Hi,
I just inherited an old gui application that was implemented using AWT,
I think circa Java 1.1. It is running on a Sun-Blade 2500 running Solaris
2.9 and JRE 1.4.2, so it should be flying, but it's not. In fact, the
performance is horrible. How should I go about improving it?
|
| Quote: | Do I upgrade
to JRE 1.5.0 first?
|
No. Last I checked, 1.5 was still beta.
| Quote: | Should I reimplement everything in Swing?
|
Probably not at this point.
| Quote: | Or do I get
a profiler, find out what the heck is killing me, and try to improve it?
|
That sounds like the right approach.
| Quote: | ANY suggestion would be helpful. Thanks!
Ric
|
Ray
--
XML is the programmer's duct tape.
|
|
| Back to top |
|
 |
Liz Guest
|
Posted: Sat Jun 26, 2004 10:00 pm Post subject: Re: old app inheritance |
|
|
"Ric Has" <rjhii (AT) sbcglobal (DOT) net> wrote
| Quote: | Hi,
I just inherited an old gui application that was implemented using
AWT,
I think circa Java 1.1. It is running on a Sun-Blade 2500 running Solaris
2.9 and JRE 1.4.2, so it should be flying, but it's not. In fact, the
performance is horrible. How should I go about improving it? Do I
upgrade
to JRE 1.5.0 first? Should I reimplement everything in Swing? Or do I
get
a profiler, find out what the heck is killing me, and try to improve it?
ANY suggestion would be helpful. Thanks!
Ric
Rumor has it that Sun has made performance improvements |
in their stuff over time so if you just recompile/run it with
J2SE 1.4.2 it might be fast enough with no real work on your
part. Keep the original though. I would stay away from 1.5
since it is not yet officially released and if there is a
problem it might be more complicated if you can't trust
the compiler/vm
|
|
| Back to top |
|
 |
Ric Has Guest
|
Posted: Mon Jun 28, 2004 6:08 pm Post subject: Re: old app inheritance |
|
|
Ok, it sounds like trying a profiler is the way to go. Does anyone have a
suggestion for one I can use?
Ric
"Ric Has" <rjhii (AT) sbcglobal (DOT) net> wrote
| Quote: | Hi,
I just inherited an old gui application that was implemented using
AWT,
I think circa Java 1.1. It is running on a Sun-Blade 2500 running Solaris
2.9 and JRE 1.4.2, so it should be flying, but it's not. In fact, the
performance is horrible. How should I go about improving it? Do I
upgrade
to JRE 1.5.0 first? Should I reimplement everything in Swing? Or do I
get
a profiler, find out what the heck is killing me, and try to improve it?
ANY suggestion would be helpful. Thanks!
Ric
|
|
|
| Back to top |
|
 |
Roedy Green Guest
|
Posted: Mon Jun 28, 2004 7:08 pm Post subject: Re: old app inheritance |
|
|
On Mon, 28 Jun 2004 11:08:37 -0700, "Ric Has" <rjhii (AT) sbcglobal (DOT) net>
wrote or quoted :
| Quote: | Ok, it sounds like trying a profiler is the way to go. Does anyone have a
suggestion for one I can use?
|
You can spend a heck of a lot money very quickly here. Try out some of
the free stuff first. See http://mindprod.com/jgloss/profiler.html
for lists of both.
--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
|
|
| Back to top |
|
 |
Ric Has Guest
|
Posted: Mon Jun 28, 2004 10:02 pm Post subject: Re: old app inheritance |
|
|
Thanks for all the advice so far. One more thing. Someone suggested that I
might want to move it to Eclipse's SWT, and that there are tools to do this
in an automated way. Can anyone tell me anything about that? Thanks.
Ric
"Ric Has" <rjhii (AT) sbcglobal (DOT) net> wrote
| Quote: | Hi,
I just inherited an old gui application that was implemented using
AWT,
I think circa Java 1.1. It is running on a Sun-Blade 2500 running Solaris
2.9 and JRE 1.4.2, so it should be flying, but it's not. In fact, the
performance is horrible. How should I go about improving it? Do I
upgrade
to JRE 1.5.0 first? Should I reimplement everything in Swing? Or do I
get
a profiler, find out what the heck is killing me, and try to improve it?
ANY suggestion would be helpful. Thanks!
Ric
|
|
|
| Back to top |
|
 |
Aditya Natarajan Guest
|
Posted: Wed Jun 30, 2004 3:15 am Post subject: Re: old app inheritance |
|
|
Ric Has wrote:
| Quote: | Thanks for all the advice so far. One more thing. Someone suggested that I
might want to move it to Eclipse's SWT, and that there are tools to do this
in an automated way. Can anyone tell me anything about that? Thanks.
Ric
"Ric Has" <rjhii (AT) sbcglobal (DOT) net> wrote in message
news:cbihjp$frp$1 (AT) nntp1 (DOT) jpl.nasa.gov...
Hi,
I just inherited an old gui application that was implemented using
AWT,
I think circa Java 1.1. It is running on a Sun-Blade 2500 running Solaris
2.9 and JRE 1.4.2, so it should be flying, but it's not. In fact, the
performance is horrible. How should I go about improving it? Do I
upgrade
to JRE 1.5.0 first? Should I reimplement everything in Swing? Or do I
get
a profiler, find out what the heck is killing me, and try to improve it?
ANY suggestion would be helpful. Thanks!
Ric
|
Whatever you do, don't rush and jump to conclusions. Don't try out
everything in a frenzy or you'll only end up with a mess of a program.
First, profile your program, try recompiling for the new runtime as
someone said earlier, and find out why the program is running so slowly
before making any changes. AWT windowing was pretty fast compared to
Swing (alright alright, don't flame me, I like Swing), with the native
peers and all, so Swing isn't likely to help. You've got a pretty good
machine, so that shouldn't be the problem (even so, would it be possible
to test out the program on another platform/machine?)
With regards to your question about a converter, I found one such beast,
but it only converts from Swing to SWT (sorry, I haven't tried it out,
so I can't vouch for it). Here you go:
http://www.swtguibuilder.com/products_s2s_download.htm
Regards,
Aditya
|
|
| Back to top |
|
 |
rancidfishbreath Guest
|
Posted: Fri Jul 09, 2004 3:41 pm Post subject: Re: old app inheritance |
|
|
| Quote: | From my experience with Swing (which is built on top of AWT so many of
the same principles apply) performance problems are usually caused by |
long running operations (such as fetching data from the database) on
the AWT event thread. Anytime you put code into a listener (such as an
ActionListener, MouseListener, etc) the code gets run on the AWT event
thread. If you tie up the thread then the screen won't repaint until
after your operation has finished and you app gets that slow clunky
feeling.
You can solve this problem by spawning new threads and putting your
long running operations on the new threads. The caveat is that you
have to call UI methods on the AWT event thread. The way to solve this
problem is to use EventQueue.invokeLater() passing in a runnable
containing code that needs to be run on the event thread.
This might be a little confusing so here is a bare bones example:
public void actionPerformed(ActionEvent ae) {
Runnable runnable = new Runnable() {
public void run() {
// Do your database or other long running operations here
// After the operations but still within you runnable
// call invokeLater:
EventQueue.invokeLater(new Runnable() {
public void run() {
// Update your AWT components from in here
textfield.setText("data from database");
}
});
}
}
new Thread(runnable).start();
}
Ric Has wrote:
| Quote: | Hi,
I just inherited an old gui application that was implemented
using AWT,
I think circa Java 1.1. It is running on a Sun-Blade 2500 running
Solaris
2.9 and JRE 1.4.2, so it should be flying, but it's not. In fact,
the
performance is horrible. How should I go about improving it? Do I
upgrade
to JRE 1.5.0 first? Should I reimplement everything in Swing? Or do
I get
a profiler, find out what the heck is killing me, and try to improve
it?
ANY suggestion would be helpful. Thanks!
Ric
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|