Bug 12246 – RedBlackTree exhibits quadratic performance with -unittest command line option

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-02-25T01:02:38Z
Last change time
2021-05-03T16:54:11Z
Keywords
performance
Assigned to
No Owner
Creator
Ivan Kazmenko
See also
https://d.puremagic.com/issues/show_bug.cgi?id=12245

Comments

Comment #0 by gassa — 2014-02-25T01:02:38Z
There is that ----- version(RBDoChecks) check(); ----- code in every meaningful operation, and a ----- version(unittest) version = RBDoChecks; ----- line at the top of std/container.d (line 217). Still, one can wish to run unit tests of one's own code, not check the integrity of the library container. I suggest to remove the -unittest => RBDoChecks implication, possibly mentioning RBDoChecks at the top of RedBlackTree documentation.
Comment #1 by gassa — 2014-02-25T01:04:46Z
Reminded by the similar issue with BinaryHeap just reported: https://d.puremagic.com/issues/show_bug.cgi?id=12245
Comment #2 by schveiguy — 2015-04-27T15:50:20Z
As an update here, I don't disagree there is a problem. But I disagree with the solution. Disabling the checks during unit tests means disabling them during Phobos unit tests. I don't think we should do this. I'd rather fix the problem of running unit tests for templates by default. I'll leave the bug open, because it's still a bug.
Comment #3 by bugzilla — 2021-05-03T16:54:11Z
Meanwhile this has been replaced by version (StdUnittest) debug = RBDoChecks; As far as I understand it, this has fixed the problem...