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

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Oct 2 03:53:47 PDT 2014


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

--- Comment #34 from Steven Schveighoffer <schveiguy at yahoo.com> ---
(In reply to Ketmar Dark from comment #33)
> (In reply to Steven Schveighoffer from comment #30)
> > bearophile or ketmar, can you test the new PR?
> for what reason? see #2 and #3, i was tried the variant without caching in
> remove().

This PR should have identical performance as your latest for the code in
question, but not cause any slowdown for remove otherwise. But my box for some
reason doesn't even exhibit the original problem with no patch. The speedup on
my system is not measurable. So I need someone to test to make sure it's
actually fixing the issue properly who does experience the problem.

>i'm telling again that remove() is NOT slowed down by any
> noticable time, and if you doing alot of removes which all happen to hit the
> first used bucket, and each such hit empties that bucket, and you used
> .byKey/.byValue beforeā€¦ this is very unusual scenario, and if you *know*
> that it goes like this, you can force rehashing.

As has been discussed, this isn't an acceptable tradeoff. Forcing a rehash for
this seems unintuitive, users will not get it. Besides, there is no reason to
recalculate cache unless you need it.

> yet i'm not interested in defending the code: i integrated it in my local
> builds since i published the patch and it's ok for me. i don't really care
> if it will make to mainline in one form on another.

Hm... people here have made a lot of effort to work with your patch given your
objections to github. Normally I would suggest that unless you submit a PR, you
will not get this code included. Your response confirms that should have been
the correct action, and I'll remember that from now on.

--


More information about the Digitalmars-d-bugs mailing list