stride in slices

David Bennett davidbennett at bravevision.com
Tue Jun 5 06:09:33 UTC 2018


On Tuesday, 5 June 2018 at 05:05:47 UTC, David Bennett wrote:
> On Tuesday, 5 June 2018 at 03:13:05 UTC, Meta wrote:
>>
>> 14 ms, 520 μs, and 4 hnsecs
>> 13 ms, 87 μs, and 2 hnsecs
>> 12 ms, 938 μs, and 8 hnsecs
>
> When using `dmd -inline -O -release` with an extra simd 
> benchmark I get:
>
> for loop:    21 ms, 291 μs, and 6 hnsecs
> stride/fill: 64 ms, 927 μs, and 9 hnsecs
> stride/each: 52 ms, 740 μs, and 8 hnsecs
> simd &=:     6 ms, 900 μs, and 8 hnsecs
>
> https://run.dlang.io/gist/5fe73cbf9943aa57be1101e597bb25e4?args=-inline%20-O%20-release
>
> Though the simd version does not work in ldc...

Here's a version that works in ldc:

https://run.dlang.io/gist/1d4bb542427fb82cc455fe9dc30185d7?compiler=ldc&args=-inline%20-O4%20-release

for loop:    16 ms, 594 μs, and 1 hnsec
stride/fill: 14 ms, 918 μs, and 9 hnsecs
stride/each: 14 ms and 813 μs
simd &=:     7 ms, 153 μs, and 6 hnsecs



More information about the Digitalmars-d mailing list