[patch 3/N] std::regex refactoring - _Executor DFS / BFS

Jonathan Wakely jwakely@redhat.com
Tue Apr 29 17:00:00 GMT 2014


On 29/04/14 12:54 -0400, Tim Shen wrote:
>On Tue, Apr 29, 2014 at 6:17 AM, Jonathan Wakely <jwakely@redhat.com> wrote:
>> This runs much faster on trunk than with 4.9.0, so we might want to
>> backport your recent patches to the gcc-4_9-branch.
>
>It's faster but nothing to do with optimization. It's because my first
>patch set the DFS approach by default, which is faster in common case
>but has bad worst case performance. Try your testcase and
>regex_match("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", regex("(a*){30}"))
>with/without defining _GLIBCXX_REGEX_USE_THOMPSON_NFA in the trunk
>version.

Ah yes, of course ... but that's still a nice improvement for people
using a regex with no back references (at least for the common cases).



More information about the Libstdc++ mailing list