|
From: | Paul Eggert |
Subject: | Re: [Grep-devel] [PATCH 2/2] grep: speed up Aho-Corasick when at most 2 bytes |
Date: | Mon, 30 Jan 2017 00:47:04 -0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 |
Norihiro Tanaka wrote:
However, Slight slowdown may be caused in following case. yes $(printf 0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c) | head -1000000 >inp time -p src/grep -F -e 0b -e ab inp I think that it is not enough to mind.
It'd be a pain to attack that problem seriously, and perhaps you're right it's not worth worrying about. Still, we can do minor tuning that should be relatively simple and trouble-free. How about the attached patch? On my platform it improves CPU performance on the above benchmark by about 23%.
0001-grep-tune-to-avoid-memchr2-sometimes.patch
Description: Text Data
[Prev in Thread] | Current Thread | [Next in Thread] |