in reply to Re: Challenge: CPU-optimized byte-wise or-equals (for a meter of beer)
in thread Challenge: CPU-optimized byte-wise or-equals (for a meter of beer)

After looking through the entries here
I found one application of memchr() (by diotalevi)

After researching into this a bit, I
found out this is by far the fastest
thing on any tested platform.

Why is that?

By looking into the memchr() sources,
ist can be seen that it's massively optimized
for DWORD aligned machine word sized
access into memory.

memchr() is, by its assembly code, a nice piece
of optimized code, especially the positional detection
and extraction of singe characters.

One can't beat this with a few lines of assembly.

I wonder if Perl uses the underlying memchr()
anywhere in its codebase (regex)?

(I updated the Benchmark sources and results.)

Regards
Mirco
  • Comment on Re^2: Challenge: CPU-optimized byte-wise or-equals (for a meter of beer)