Searched hist:"88521634 e964e3da78a0ce54109cddb59bf3f099" (Results 1 – 3 of 3) sorted by relevance
/freebsd/lib/libc/string/ |
H A D | memmem.3 | diff 88521634e964e3da78a0ce54109cddb59bf3f099 Sat Mar 18 01:51:39 CET 2017 Ed Maste <emaste@FreeBSD.org> libc: Use musl's O(n) memmem and strstr
It is O(n) in the length of the haystack (big) string, and has special cases for short needle (little) strings, of one to four bytes, to avoid excessive overhead.
There are a small set of nearly trivial cases where the startup overhead of the musl implementation makes it slightly slower -- for example, a 31 byte needle that matches the beginning of the haystack. It's faster for non-trivial cases, and significantly so for inputs that trigger worst- case behaviour of the previous implementation. As an example, in my tests a 16K needle that matches the end of a 64K haystack is nearly 2000x faster with this implementation.
Reviewed by: bapt (earlier), ed (earlier) Obtained from: musl (snapshot at commit c718f9fc) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D2601
|
H A D | memmem.c | diff 88521634e964e3da78a0ce54109cddb59bf3f099 Sat Mar 18 01:51:39 CET 2017 Ed Maste <emaste@FreeBSD.org> libc: Use musl's O(n) memmem and strstr
It is O(n) in the length of the haystack (big) string, and has special cases for short needle (little) strings, of one to four bytes, to avoid excessive overhead.
There are a small set of nearly trivial cases where the startup overhead of the musl implementation makes it slightly slower -- for example, a 31 byte needle that matches the beginning of the haystack. It's faster for non-trivial cases, and significantly so for inputs that trigger worst- case behaviour of the previous implementation. As an example, in my tests a 16K needle that matches the end of a 64K haystack is nearly 2000x faster with this implementation.
Reviewed by: bapt (earlier), ed (earlier) Obtained from: musl (snapshot at commit c718f9fc) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D2601
|
H A D | strstr.c | diff 88521634e964e3da78a0ce54109cddb59bf3f099 Sat Mar 18 01:51:39 CET 2017 Ed Maste <emaste@FreeBSD.org> libc: Use musl's O(n) memmem and strstr
It is O(n) in the length of the haystack (big) string, and has special cases for short needle (little) strings, of one to four bytes, to avoid excessive overhead.
There are a small set of nearly trivial cases where the startup overhead of the musl implementation makes it slightly slower -- for example, a 31 byte needle that matches the beginning of the haystack. It's faster for non-trivial cases, and significantly so for inputs that trigger worst- case behaviour of the previous implementation. As an example, in my tests a 16K needle that matches the end of a 64K haystack is nearly 2000x faster with this implementation.
Reviewed by: bapt (earlier), ed (earlier) Obtained from: musl (snapshot at commit c718f9fc) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D2601
|