Inherent code performance advantages of D over C?
bearophile
bearophileHUGS at lycos.com
Fri Dec 6 15:56:48 PST 2013
H. S. Teoh:
>(if your tree is 1 million nodes, then it
> has to do 1 million free's, right then, right there,
In practice real C programs use arenas and pools to allocate the
nodes from. This sometimes doubles the performance of C code that
has to allocate many nodes of a tree data structure. A simple
example:
http://rosettacode.org/wiki/Self-referential_sequence#Faster_Low-level_Version
Some of such code will become useless once Phobos has Andrei
allocators :-)
In C sometimes you also use hierarchical memory allocation, to
simplify the memory management
(http://swapped.cc/?_escaped_fragment_=/halloc#!/halloc ), not
currently supported by Andrei allocators.
Bye,
bearophile
More information about the Digitalmars-d
mailing list