Benchmark memchar (with GCC builtins)
Dmitry Olshansky via Digitalmars-d
digitalmars-d at puremagic.com
Sat Oct 31 01:04:10 PDT 2015
On 31-Oct-2015 00:29, Iakh wrote:
> I continue to play with SIMD. So I was trying to use std.simd
> But it has lots of thing to be implemented. And I also gave up with
> core.simd.__simd due to problems with PMOVMSKB instruction (it is not
> implemented).
>
> Today I was playing with memchr for gdc:
> memchr: http://www.cplusplus.com/reference/cstring/memchr/
> My implementations with benchmark:
> http://dpaste.dzfl.pl/4c46c0cf340c
>
> Benchmark results:
> -----
> Naive: 21.9 TickDuration(136456491)
> SIMD: 3.04 TickDuration(18920182)
> SIMDM: 2.44 TickDuration(15232176)
> SIMDU: 1.8 TickDuration(11210454)
> C: 1 TickDuration(6233963)
>
More or less matches my experience with C's memchr vs something else -
it's fastest portable solution to find a byte in a chunk of memory.
--
Dmitry Olshansky
More information about the Digitalmars-d
mailing list