Expected performance
Aarti_pl
aarti at interia.pl
Wed Nov 7 02:06:55 PST 2007
Martin Hess pisze:
> I'm considering D for a project that is very CPU intensive so I'm evaluating D's performance. As a first test I started with associative arrays and ended up with a result that surprised me a bit so I would like to get some input on the test's construction.
>
> The test builds a dictionary of 50k byte arrays that map to integers.
>
> int[byte[]] dictionary;
>
> Next it looks up elements a half billion times.
>
> Assuming 1.5 instructions per cycle I'm seeing about 387 instructions per lookup.
>
> I tried it in Java and was seeing about 309 instructions per lookup.
>
> Nievely I assumed I would get better performance that Java. Does anyone have any thoughts on this?
>
Did you turn on optimizations when compiling D code?
-inline do function inlining
-O optimize
-release compile release version
BR
Marcin Kuszczak
(aarti_pl - www.zapytajmnie.com)
More information about the Digitalmars-d
mailing list