T
Tristan
Hi,
My code reads through a file of shapes adding each
one to an ArrayList as it does so.
The problem is that for files with large numbers of
shapes, calling ArrayList.Add(MyShape) is
exceptionally slow.
There is no way of knowing how many shapes need to
be read in so I can't set the ArrayList capacity
and use array indexing to add the shape objects.
I am prepared to use another collection if it
will be quicker and allow quick addition and
retrieval of objects (not so worried about
insertions and deletions), would SortedList.Add()
be any quicker?
Is there any way around this problem?
Any help will be much appreciated.
Tristan.
My code reads through a file of shapes adding each
one to an ArrayList as it does so.
The problem is that for files with large numbers of
shapes, calling ArrayList.Add(MyShape) is
exceptionally slow.
There is no way of knowing how many shapes need to
be read in so I can't set the ArrayList capacity
and use array indexing to add the shape objects.
I am prepared to use another collection if it
will be quicker and allow quick addition and
retrieval of objects (not so worried about
insertions and deletions), would SortedList.Add()
be any quicker?
Is there any way around this problem?
Any help will be much appreciated.
Tristan.