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!
Re: Default List Model is Slow
Quote:
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.
Quote:
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.
Re: Default List Model is Slow
Thank you! I am going to try this.