aspose file tools*
The moose likes Beginning Java and the fly likes Need Peter's Opinion and others' for unrevised Swing performance in Tiger Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Need Peter Watch "Need Peter New topic
Author

Need Peter's Opinion and others' for unrevised Swing performance in Tiger

Ko Ko Naing
Ranch Hand

Joined: Jun 08, 2002
Posts: 3178
I've heard that Swing API is left by the Tiger designers to revise... Swing's bad performance has been very famous for years and it seems that SWT applications are gradually replacing the Swing desktop applications...

Peter, how do u think about the ignorance of Swing API by Tiger designer? And is the JFC and the Swing Package, Chapter-21, in your book still based on J2SE 1.4?

Thanks...


Co-author of SCMAD Exam Guide, Author of JMADPlus
SCJP1.2, CCNA, SCWCD1.4, SCBCD1.3, SCMAD1.0, SCJA1.0, SCJP6.0
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24184
    
  34

Originally posted by Ko Ko Naing:
Swing's bad performance has been very famous for years ...


Mostly among people who don't know what they're talking about. Java2D's performance improved by a quantum leap with JDK 1.4, and 1.3 was itself a big improvement over 1.2. Swing's performance is great, now. I use both IntelliJ IDEA (a Swing GUI app) and Eclipse (the SWT app) and, if anything, IDEA is snappier. It certainly looks better (this is on Linux, an unfair comparison, I know.)


[Jess in Action][AskingGoodQuestions]
Peter van der Linden
author
Ranch Hand

Joined: Sep 28, 2004
Posts: 46
Hi Ko Ko,

Good to hear your views. You are saying that you've seen less than crisp performance
on Swing desktop apps in the past, and you are wondering if there are any improvements
to Swing performance in Tiger.

Well, the answer is a resounding YES, you will no doubt be pleased to hear. Swing performance
is markedly improved in Java 5, just as we have seen improvements in all the earlier
releases, (just as Ernest gives the details).

In fact, the desktop client is one of the six big themes defining the Java 5 release! The whole
list is:
1. quality is job #1
2. performance and scalability
3. monitoring and manageability
4. desktop client
5. ease of development
6. core XML support

I already mentioned the class data sharing boost. The development team also put a lot
of effort into memory footprint reduction of the runtime library. And the run time library
will be shared among all JVMs, rather than loaded individually for each new program. So
that speeds up start time when you have several Java programs running.

There has also been more work done on the Hotspot compiler.

The lead architect for Java 5, Graham Hamilton blogged his thoughts:
"We've worked to improve both the performance of the Java desktop client, but also the GUI
look-and-feels. We've continued to improve the quality of the Windows XP look-and-feel
and the GNOME GTK look-and-feel." So I think that is evidence of effort being put into
Swing at the highest levels.

There weren't too many Swing changes in the Java 5 release. Were you thinking of something
specific? One thing that made me laugh out loud was that you can now add components
directly to a container, rather than getting the content pane first and adding to that! It
should have been done like that from the start, but a correction after 8 years is better than
no correction.

There is a new cross-platform theme, "Ocean". But most of the Swing changes are in
performance, not API semantics, so the examples in Just Java do not change for
Java 5 in terms of screen dumps.

Hope this helps. I am really looking forward to seeing some Swing benchmarks. And
I encourage everyone to download the FCS (First Customer Ship) version of Java 5
which is up on the Sun website even as I write! http://java.sun.com

Cheers,

Peter


Author of <a href="http://www.amazon.com/exec/obidos/ASIN/0131482114/ref=jranch-20" target="_blank" rel="nofollow">Just Java(TM) 2 (6th Edition)</a>
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

One of the most exciting improvements to Swing performance for me was the ability to utalize the Opengl pipeline for aid in rendering the Graphics2D API which swing makes heavy use of.


GenRocket - Experts at Building Test Data
friso dejonge
Ranch Hand

Joined: Jul 11, 2002
Posts: 162
I know this is not a discussion about performance of swing, but most performance issues are caused by bad coding and design. I do not dispute that performance is/was great, but most problems could have been prevented by correct use of design patterns.


swimming certificate (A & B), shoelaces diploma, and some useless java ones.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Originally posted by friso dejonge:
I know this is not a discussion about performance of swing, but most performance issues are caused by bad coding and design. I do not dispute that performance is/was great, but most problems could have been prevented by correct use of design patterns.


Good point. Problem is no one but a select few know what design patterns to use for Swing. There are no books on the subject and finding coherent, conclusive information online is like pulling teeth.
Ko Ko Naing
Ranch Hand

Joined: Jun 08, 2002
Posts: 3178
Originally posted by Gregg Bolinger:


Good point. Problem is no one but a select few know what design patterns to use for Swing. There are no books on the subject and finding coherent, conclusive information online is like pulling teeth.


I agree with Gregg and I would like to add more about the design patterns to use for Swing... We can rarely be able to find a good resources about design patterns that is well-suited and applied to Swing desktop applications in the real project...

I used to develop a CRM application using Swing for about six months in my previous project... At that time, I didn't notice the greatest power of SWT. I would have used SWT, instead of Swing, if I knew SWT before that project... But after I read Peter's opinion about the improvement to Swing in J2SE 5.0, I am thinking to tune that CRM application to be compatible with J2SE 5.0 and ship one more time...

Anyway, I would like to thank Peter very much for his comment on Swing in J2SE 5.0 and Gregg for additional comment...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need Peter's Opinion and others' for unrevised Swing performance in Tiger