A significant performance difference

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


On Mon, 1 Sep 2014 09:21:03 +0200
Daniel Kozak via Digitalmars-d-learn
<digitalmars-d-learn at puremagic.com> wrote:

> I think main problem is in calling delegates (x.byKey.front and
> x.byValue.front;). If I change x.byValue.front with x[j], It makes
> program a lot faster
yes. replacing `p = x.byValue.front;` by `p = x[j];` cutted
down execution time from 3.2 seconds to 1.8 seconds with my gdc.

i always dreamt about official 'get any key from AA' API. and, btw,
'get value and remove key' API too. they are useful sometimes.

seems that i have to write another silly patch for this. ;-)
-------------- 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/9ffc0ca6/attachment.sig>


More information about the Digitalmars-d-learn mailing list