Re: bug#22357: grep -f not only huge memory usage, but also huge time cost

2016-12-11 Thread Paul Eggert
arn...@skeeve.com wrote: I'm sure that Paul and Jim would welcome patches. I wrote a patch that prefers -F when the input looks like a troublesome case. It merely uses heuristics though, nothing scientific like what Bruno Haible suggested. Before installing anything like that, I'd first like

Re: bug#22357: grep -f not only huge memory usage, but also huge time cost

2016-12-11 Thread arnold
Bruno Haible wrote: > Finally, code this formula into the 'grep' program. I'm sure that Paul and Jim would welcome patches. Arnold

Re: bug#22357: grep -f not only huge memory usage, but also huge time cost

2016-12-11 Thread Bruno Haible
Trevor Cordes wrote: > I've read in numerous places (O'Reilly books mostly) that grep or pcre > is often/sometimes faster than fgrep, so I think it is (somewhat) common > knowledge and I wouldn't worry too much about that perception. It is wrong to put the burden of the algorithm choice on the use

Re: bug#22357: grep -f not only huge memory usage, but also huge time cost

2016-12-11 Thread Norihiro Tanaka
On Sun, 11 Dec 2016 05:28:56 -0600 Trevor Cordes wrote: > On my box the above runs for >2m (never completes before I ^C) on the > version **AFTER** the commits (v2.22). On the test build just *BEFORE* > the commits (2.21.73-8058), it runs in <2s. So for me, I had a working > command (-F -w -f)

Re: bug#22357: grep -f not only huge memory usage, but also huge time cost

2016-12-11 Thread Trevor Cordes
On 2016-12-11 Norihiro Tanaka wrote: > The changes switch used algorithm. They convert grep -w -F to grep > -w. Hi, thanks for helping! Sorry, yes, I forgot I was using --fixed-strings (-F), so yes, my example should have used -F. > Try following test case and before and after the changes, plea