[Issue 13410] Performance problem with associative array byKey/byValue
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Wed Oct 1 02:43:37 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=13410
--- Comment #26 from bearophile_hugs at eml.cc ---
(In reply to Martin Nowak from comment #24)
> So unless there is a valid use case to call aa.byKey.front in a loop this
> would only improve a pointless microbenchmark.
See here, it's not just a pointless microbenchmark:
http://forum.dlang.org/thread/efmjlfpehqqfszcrxmwq@forum.dlang.org
As shown by others, there are ways to rewrite that code to avoid most of the
very slow part, but popping the "first" item from an an associative array is a
sufficiently common operation (I have written and seen plenty of Python code
that does it).
--
More information about the Digitalmars-d-bugs
mailing list