optimized array operations

bearophile bearophileHUGS at lycos.com
Mon Sep 22 17:48:41 PDT 2008


Denis Koroskin:
> New hardware - new results (-O -release -inline):
> length=1
> _add Time elapsed: 91.212/0 ticks OK
> _sub Time elapsed: 89.8235/0 ticks OK
> add Time elapsed: 82.6135/0 ticks OK
> sub Time elapsed: 84.2032/0 ticks OK
> mul Time elapsed: 82.8325/0 ticks OK
> div Time elapsed: 99.2924/0 ticks OK
...

I don't understand how to read the timings, are the timings before the slash of the current implementation, and the timings after the slash of your new code?

Regarding your code, lines as:
foreach (i; 0 .. 10_000_000) {
Probably need to be rewritten as:
for (int i; i < 10_000_000; i++) {

Because array operations are present in D1 too, and it may be better to write code that works on both D1/D2 if possible (so Walter has less code differences to manage).

Bye,
bearophile


More information about the Digitalmars-d-announce mailing list