[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#43527: [PATCH] grep: avoid unneeded compilation of regex
From: |
Norihiro Tanaka |
Subject: |
bug#43527: [PATCH] grep: avoid unneeded compilation of regex |
Date: |
Sun, 20 Sep 2020 16:16:43 +0900 |
Hi,
Performace for as following case is fixed in bug#43040.
$ yes 0 | head -100000 | sed '$s/././' >pat
$ grep -vf pat /dev/null
However, still slow and a lot of memory wasted for the following cases.
$ grep -vf /usr/share/dict/linux.words /usr/share/dict/linux.words
This bug is introduced in commit abb7f4f2325f26f930ff59b702fe42568a8e81e7.
Though it's an optimization for patterns with backreferences, it seems
to cause performance degradation in many cases due to regex
implementation issues.
grep needs regex engine when patterns is not supported by DFA engine,
and when either given only matching (-o) or color option (--color) is
given.
In other words, if none of them are met, grep only uses regex to check
the syntax. grep avoids compilation of regex not to check syntax by this
patch.
0001-grep-avoid-unneeded-compilation-of-regex.patch
Description: Text document
0001-dfa-change-dfasupported-to-global-function.patch
Description: Text document
- bug#43527: [PATCH] grep: avoid unneeded compilation of regex,
Norihiro Tanaka <=
- bug#43527: [PATCH] grep: avoid unneeded compilation of regex, Jim Meyering, 2020/09/20
- bug#43527: [PATCH] grep: avoid unneeded compilation of regex, Jim Meyering, 2020/09/21
- bug#43527: [PATCH] grep: avoid unneeded compilation of regex, Norihiro Tanaka, 2020/09/22
- bug#43527: [PATCH] grep: avoid unneeded compilation of regex, Jim Meyering, 2020/09/22
- bug#43527: [PATCH] grep: avoid unneeded compilation of regex, Norihiro Tanaka, 2020/09/22
- bug#43527: [PATCH] grep: avoid unneeded compilation of regex, Jim Meyering, 2020/09/22
- bug#43527: [PATCH] grep: avoid unneeded compilation of regex, Norihiro Tanaka, 2020/09/22
- bug#43527: [PATCH] grep: avoid unneeded compilation of regex, Jim Meyering, 2020/09/23
- bug#43527: [PATCH] grep: avoid unneeded compilation of regex, Paul Eggert, 2020/09/23
- bug#43527: [PATCH] grep: avoid unneeded compilation of regex, Jim Meyering, 2020/09/23