Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.)
 
Peter van der Linden
author
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
friso dejonge
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic