Playing SIMD

rumbu via Digitalmars-d digitalmars-d at puremagic.com
Mon Oct 26 05:10:39 PDT 2015


On Monday, 26 October 2015 at 11:47:56 UTC, Andrei Alexandrescu 
wrote:
> On 10/26/2015 05:48 AM, Iakh wrote:
>> On Monday, 26 October 2015 at 00:00:45 UTC, anonymous wrote:
>>> runBinary calls naiveIndexOf. You're not testing 
>>> binaryIndexOf.
>>
>> You are right.
>> This is fixed example:
>> http://dpaste.dzfl.pl/f7a54b789a21
>>
>> and results at dpaste.dzfl.pl:
>> -----
>> SIMD:   TickDuration(151000)
>> Binary: TickDuration(255000)
>> Naive:  TickDuration(459000)
>>
>> So SIMD version ~1.68 faster than binary
>
> That's a healthy margin. It may get eroded by startup/finish 
> codes that need to get to the first aligned chunk and handle 
> the misaligned data at the end, etc. But it's a solid proof of 
> concept. -- Andrei

Interpolation search is even faster :)

http://dpaste.dzfl.pl/4443c5753454

-----
SIMD:          TickDuration(144000)
Binary:        TickDuration(229000)
Naive:         TickDuration(472000)
Interpolation: TickDuration(92000)
-----
SIMD:          TickDuration(145000)
Binary:        TickDuration(247000)
Naive:         TickDuration(463000)
Interpolation: TickDuration(91000)





More information about the Digitalmars-d mailing list