https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82345
Bug ID: 82345 Summary: low performance (comparing to clang) Product: gcc Version: 7.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: claprix at yandex dot ru Target Milestone: --- String search is slow for this code. $ g++ -O2 -DNDEBUG -std=c++14 gcc_perf_buf.cc && time ./a.out shodan/huge01.txt real 0m0.470s user 0m0.367s sys 0m0.104s $ clang++ -O2 -DNDEBUG -std=c++14 gcc_perf_buf.cc && time ./a.out shodan/huge01.txt real 0m0.248s user 0m0.179s sys 0m0.069s $ gcc --version gcc (Ubuntu 7.2.0-7ubuntu1) 7.2.0 Copyright (C) 2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ lsb_release -d Description: Ubuntu Artful Aardvark (development branch)