Win a copy of Transfer Learning for Natural Language Processing (MEAP) this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
Bartenders:
  • salvin francis
  • Carey Brown
  • Frits Walraven

ClassLoader

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have a Swing JFrame, which loads on a menu click. The screen is not too simple, but not too complicated either. It has 2 toolbars, a menubar, a JPanel(consisting of a JTable and a filter panel) and a right click context menu for the table. The very first time the screen is loaded, it takes forever fo it to come up. However, it's not as slow the cnsecutive times. I've put it through JProfiler and found out that the majority time is consumed by class loader. Any ideas, how to improve the performence here?

Also, is there a free good profiler that I can use with Eclipse 3.3?

Thanks!
 
Ranch Hand
Posts: 262
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I have a Swing JFrame, which loads on a menu click ...



It sounds like your JFrame is not the first thing that gets loaded in your application, since you mention that it gets loaded form a user's menu click. You might consider having your starting GUI component spawn asimple background thread that calls

Class.forName(SlowLoadingSwingJFrameClass);

That way, when your user finally clicks on the menu, there's a good chance that the classloader will have already loaded the slow-loading Swing JFrame.
 
Look ma! I'm selling my stuff!
Two software engineers solve most of the world's problems in one K&R sized book
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic