Results 1 to 3 of 3
  1. #1
    prescott is offline Member
    Join Date
    Oct 2011
    Posts
    4
    Rep Power
    0

    Default Default List Model is Slow

    Hello,

    I have been using a default list model in a JList for a glossary program. There are about 17,000 entries loaded in from an object input stream. The string identifier of each entry is loaded into a default list model<String> displayed on the JList. The problem, is, it takes about half an hour to load the thing. Is this a problem with the object input stream or (as I suspect) the default list model and is there anything that can be done to make it faster?

    Help would be greatly appreciated! Thank you!

  2. #2
    camickr is offline Senior Member
    Join Date
    Jul 2009
    Posts
    1,233
    Rep Power
    7

    Default Re: Default List Model is Slow

    or (as I suspect) the default list model
    I doubt it is the ListModel. To improve performance a little create a Vector that has space for 17k entries and use the Vector to create the model. This way the Vector doesn't have to keep increasing its size as you add an entry.

    Is this a problem with the object input stream
    That would be my guess, although 30 minutes still sounds too long. Maybe you need to store the data in a different format to reduce the I/O and the overhead of recreating all those objects.

  3. #3
    prescott is offline Member
    Join Date
    Oct 2011
    Posts
    4
    Rep Power
    0

    Default Re: Default List Model is Slow

    Thank you! I am going to try this.

Similar Threads

  1. Replies: 6
    Last Post: 11-03-2011, 08:32 AM
  2. How to print from Default List Model
    By mutagen in forum AWT / Swing
    Replies: 1
    Last Post: 03-23-2011, 10:13 AM
  3. Copy Default table model to another default table model?
    By greatmajestics in forum AWT / Swing
    Replies: 2
    Last Post: 04-28-2010, 04:08 PM
  4. Replies: 1
    Last Post: 03-10-2009, 01:12 PM
  5. eclipse very slow
    By katie in forum Eclipse
    Replies: 2
    Last Post: 11-05-2007, 10:20 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •