[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[computer-go] space efficiency in C++



Hi all,
I've got a problem with efficiency in memory use that I thought someone here might be able to help me with.

I'm using C++, and I have a class: tree, that contains a member object list<tree *> children. I think I do want a list here, because I do a lot of deleting individual elements. My tree objects are very big, in fact their size is the main performance limiting factor in my programme. However, the lists of children are typically quite short, often one or two elements. My implementation of the Standard C++ Library seems to allocate space for each list in batches of 256 links (which I suspect is typical). This leads to my tree occupying about 100 times as much space as it should.

Has anyone else come across this problem Does anyone have an idea for a work-around? Do I have to abandon the standard library for this application?

Thanks.
Tom.


_______________________________________________
computer-go mailing list
computer-go@xxxxxxxxxxxxxxxxx
http://www.computer-go.org/mailman/listinfo/computer-go/