PATCH] Improve performance of memmem

Eric Blake
Tue Jan 1 16:00:00 GMT 2019

On 12/19/18 9:26 AM, Wilco Dijkstra wrote:
> Hi,
> Here is version 2 with improved comments and spaces:
> This patch significantly improves performance of memmem using a novel
> modified Horspool algorithm.  Needles up to size 256 use a bad-character
> table indexed by hashed pairs of characters to quickly skip past mismatches.
> Long needles use a self-adapting filtering step to avoid comparing the whole
> needle repeatedly.

I've gone ahead and pushed this.  Thanks again for tackling this project.

Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization: |

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the Newlib mailing list