GNU bug report logs -
#18454
Improve performance when -P (PCRE) is used in UTF-8 locales
Previous Next
Full log
View this message in rfc822 format
On 2014-09-12 03:24:49 +0200, Vincent Lefevre wrote:
> Timings with the Debian packages on my personal svn working copy
> (binary + text files):
>
> 2.18-2 0.9s with -P, 0.4s without -P
> 2.20-3 11.6s with -P, 0.4s without -P
I've done another test on a large PDF file. Let's forget grep 2.18,
which is indeed too buggy (I could reproduce a buffer overflow). But
let's compare with pcregrep, using the "zzz" pattern:
Debian grep 2.20-3 6.64s (with -P)
Upstream grep 2.21 5.39s (with -P)
Debian pcregrep 8.35 0.71s
In all cases, PCRE is used, but pcregrep is much faster than grep -P.
(Note: on this example, "grep" alone is much faster than pcregrep,
but this is not related to the invalid encoding, and depending on
the pattern, either grep or PCRE can be significantly faster.)
So, perhaps that the right method would be to do what pcregrep does,
even though "grep -P" can currently be a bit faster than pcregrep in
some cases.
--
Vincent Lefèvre <vincent <at> vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
This bug report was last modified 3 years and 181 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.