std.container.RedBlackTree versus C++ std::set
Rob T
alanb at ucora.com
Wed Feb 13 16:09:09 PST 2013
You can check if disabling the GC just before the insert process
improves the performance. You may see 3x performance improvement.
Disabling is safe provided you re-enable, this can be done
reliably with scope(exit) or something similar.
import core.memory;
// ...
void main ()
{
auto f = new container ();
element.postblit_counter = 0;
GC.disable;
foreach (i; 0..LIMIT)
{
f.insert (element (i));
}
GC.enable;
writefln ("%s", element.postblit_counter);
}
--rt
More information about the Digitalmars-d-learn
mailing list