[Bug libstdc++/83607] New: std::boyer_moore_searcher is slow searching through arrays of std::byte
m101010a at gmail dot com
gcc-bugzilla@gcc.gnu.org
Thu Dec 28 07:49:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83607
Bug ID: 83607
Summary: std::boyer_moore_searcher is slow searching through
arrays of std::byte
Product: gcc
Version: 7.2.1
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: m101010a at gmail dot com
Target Milestone: ---
Created attachment 42975
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42975&action=edit
C++17 program demonstrating the issue
When using std::boyer_moore_searcher on an array of std::bytes, it is 3 times
as slow as memmem. When using std::boyer_moore_searcher on an array of
unsigned char, it is faster them memmem. This is because the searcher uses an
array when searching through unsigned chars, but uses a hash table when
searching through std::byte. Searches through std::byte should also use an
array, since it has the same size and equality semantics as unsigned char.
More information about the Gcc-bugs
mailing list