bug-gnulib
[Top][All Lists]
Advanced

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

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


From: L.A. Walsh
Subject: Re: bug#22357: grep -f not only huge memory usage, but also huge time cost
Date: Thu, 15 Dec 2016 01:55:44 -0800
User-agent: Thunderbird

Norihiro Tanaka wrote:
dfa matcher is not always slower than kws matcher.
- $ env LC_ALL=C grep -F -w 0 k

- $ env LC_ALL=C grep -F -w -f /usr/share/dict/words /dev/null

First is faster after the changes, and second is slower after the
changes.  It's a trade-off.  Can you have any idea to select the better
matcher for both two cases?
----
If a way can't be found to determine the best choice algorithmically, then
on a multiprocessor machine, run both at the same time.  First one to
complete terminates the slow poke.

   It's similar to how some think the brain works in computing multiple
potential paths at the same time where early returns may not be the most
accurate, but might be better than nothing.
   Given time, (meditation, "I think I'll sleep on it" [the problem],
"thinking about it", etc..), a more complete answer can be found.
   In this case, with extreme time differences and a possible,
quick & accurate fast resolution, searching in parallel, while not trivial
in our linear programming languages, would almost certainly yield a faster
result.

   Using parallel solutions should be the default on a multi-core machine.







reply via email to

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