[Issue 13410] Performance problem with associative array byKey/byValue

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Oct 10 14:59:52 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=13410

--- Comment #39 from Steven Schveighoffer <schveiguy at yahoo.com> ---
Bearophile,

With the tree-based solution, when the front element is removed, the "next"
element is 1 hop away.

But with hash, it can be far away in the table. So you likely are better off
using a tree-based map, something like RedBlackTree if you want to come close
to C++ performance.

There is also the issue that C++ uses a template-based map, so it can optimize
the code, inline comparisons, etc. The AA-based solution cannot do this.

--


More information about the Digitalmars-d-bugs mailing list