A significant performance difference

ketmar via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Sep 1 02:09:06 PDT 2014


On Mon, 01 Sep 2014 08:53:45 +0000
bearophile via Digitalmars-d-learn <digitalmars-d-learn at puremagic.com>
wrote:

> ketmar:
> Thank you for your analysis and code.
actually, it's based on Daniel Kozak's observation, so credit him
instead. ;-)

> But I think the "j = x.byKey.front;  p = x.byValue.front;" code 
> looks sufficiently idiomatic, and its performance is terrible.

that's why i suggest to extend AA API, adding x.firstKey and
x.firstValue functions. i'll try to make the patch soon.

ah, and x.getAndRemove() too, it's handy sometimes. but this will
need new druntime hook, i think. ;-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20140901/86251225/attachment.sig>


More information about the Digitalmars-d-learn mailing list