On 10 Dec 2007 at 16:02, David kerber wrote:
> I'm running this app in a tomcat 5.5.x container,I am trying to > figure > out which form of a list is the best for what I need to do here: > > I need to have some kind of list or collection that I can search > quickly > for a specific entry, and then start stepping through the list item > by > item from that point. The items in the list are all of the same > user-defined class (not primitives or pre-defined java classes). > > My current implementation just uses an iterator starting at the > beginning, and just walking through until I find the item I want, > and > continuing to walk from there, but I'm running into performance > issues > with this. > > The individual lists aren't particularly big: single-digits to at > most > a couple hundred items, but I do this processing in a big outer loop > which will need to scale up to a few thousand iterations of > different > instances of these lists. What these actually are is individual > stores' > inventory data, with each list being a list of their inventory data > for > a month or so, and I will eventually need to iterate over a couple > thousand stores for reporting. Where is this data coming from? I would personally use a combo of LinkedList http://java.sun.com/j2se/1.5.0/docs/api/java/util/LinkedList.html where each node would have something like an id of the store and use that id to retrieve the data from a database. Keeping less data in each node should make searching the list fast. Another idea would be to use hashtable of linked lists but it all depends on what you're searching. -Steve O. --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]