"James Kanze" <james.ka...@gmail.comwrote in message
news:10**********************************@a26g2000 prf.googlegroups.com...
On Nov 18, 4:15 pm, "Chris M. Thomasson" <n...@spam.invalid>
wrote:
In other words, extra work. That's exactly what Matthias was
arguing against.why free the memory when you can reuse some of it?Why do extra work when you don't have to?You can do this in a GC environment, but it requires you to
traverse a "portion" of the tree.
A node cache reduces the number of calls to `new'; IMHO, thisThe best thing would be that the program would use no memory,
is a good thing.
run in 0 time, and be ready last week, with no programmers
having worked on it. It's not going to happen, so we have to
compromize. Reducing the number of calls to new might be a good
thing (although it's not been proven), but is it worth more
money than it costs to implement it?
Also, why not use a __partitioned__ region allocationFor the programmer?
algorithm for the nodes in different trees? That way, a single
call to `std::free()' will promptly destroy all the memory
which makes up a given trees nodes in a single operation.
AFAICT, that's more efficient than a GC.
For the program.For what aspect of the program? Development cost?
Maintainability?
Since when is writing additional code more efficient.
Its worth it that extra work increases the scalability,If scalability, throughput and performance are not adequate
throughput and performance of a program.
otherwise, then you have to do something. There are certainly
some applications where garbage collection has no place. But
they're not typical; most of the time, garbage collection will
save programmer time (and thus money) at a negligible cost
elsewhere.
--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34