BinaryHeap.insert, conditionalInsert and replaceFront all call assertValid,
which goes through the complete heap to check for correct structure. This
results in unusable performance in debug mode due to the quadratic run time.
Arguably, such costly algorithm validation should be left for a unit test
instead.
I think implying "unittest => slow but checked containers" is not the way to go, either. Imagine a module making heavy use of containers and just wishing to run the module's own unittests. With such implication, there would be no fast way to do that. Or is there a way to import the generic container from std.container without propagating the "-unittest" flag? It's a generic after all, so it can't be compiled separately, right?
A better way would be to (create and) mention a version flag needed for container debugging in the documentation for the respective container.
Comment #3 by peter.alexander.au — 2014-03-02T08:38:05Z