C (241/304)

From:Jack York
Date:27 Aug 2000 at 20:07:00
Subject:Re: Freeing list with Classact

Hello Rod

On 02-Aug-00, Rod Schnell wrote:

> First off, I have to wonder just how many ListBrowserNodes are in your
> list and how big the nodes are?

After I got your reply I decided to write a separate program with just a
listbrowser and see how long it would take to remove a list. And sure
enough even lists of 40,000 free very quickly. The code was the same as
in my main program except that in my main program I create two lists,
one containing all items and one only certain items. I didn't think the
second list had any bearing on the original question so I didn't mention
it, trying to keep the question as short as possible. So I went back to the

test program and added another list. Then I recorded the time it takes
for each list to free. I chose a list size of 5000 entries. The first list
to
be freed took 20 seconds while the second takes 3 seconds. All the code
is identical as far as the two lists are concerned, just the list names are
different. If I watch the memory size on the DOpus title bar while
the lists are being freed, the first list frees about 100,000 bytes per
update
while the second frees about 1,000,000 per update. If I go back to my
original program and disable the secondary list, it runs fine and frees
all memory very quickly. So now I guess my question is whether or not I
can have more than one list and still keep the speed up? Does anyone
have an idea/suggestion on this?

>
> Secondly, I don't use FreeListBrowserNodes() myself, in fact it's not even

typeo^
> in the beta version of classact.library that I have. A much better way is
> to detach
> the list, walk it, free each node and then reattach the list after all the
> nodes have been freed. This way there's only one refresh.

This is how I do it too. I'm not getting any hits, just slow memory
freeing.

Jack