bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#22655: grep -Pz '^' now fails!


From: Paul Eggert
Subject: bug#22655: grep -Pz '^' now fails!
Date: Fri, 18 Nov 2016 08:48:04 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0

Stephane Chazelas wrote:
Why would it make it slower. AFAICT, PCRE_MULTILINE *adds*
some overhead.

As I understand it, PCRE_MULTILINE lets 'grep' apply a pattern to an entire buffer that contains many lines, and this lets PCRE efficiently find the first match in the whole buffer. If grep doesn't use PCRE_MULTILINE, grep would have to apply the pattern to each line separately, which could be significantly slower.

That being said, PCRE matching is pretty slow already, so perhaps we shouldn't worry about efficiency here.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]