optimized array operations

Eugene Pelekhay pelekhay at gmail.com
Tue Sep 23 00:02:27 PDT 2008


bearophile Wrote:

> 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


timings shown per implementation for aligned/unaligned data. 
name of function with underscore it's default/current implementation without new optimized version

regarding rewriting loops, may be You right, I didn't checked if it even compiled by D 1.0, however major code differcence will be in benchmark function wich is not intended for inclusion in librariy





More information about the Digitalmars-d-announce mailing list