grep-devel
[Top][All Lists]
Advanced

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

Re: [Grep-devel] [PATCH 2/2] grep: speed up Aho-Corasick when at most 2


From: Norihiro Tanaka
Subject: Re: [Grep-devel] [PATCH 2/2] grep: speed up Aho-Corasick when at most 2 bytes
Date: Tue, 31 Jan 2017 09:02:38 +0900

On Mon, 30 Jan 2017 00:47:04 -0800
Paul Eggert <address@hidden> wrote:

> 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%.

Thanks.  I tested it on following platform, and got 1.51sec with both
before and after.

Intel(R) Core(TM) i5-6400 CPU @ 2.70GHz
Linux rhel6 2.6.32-642.el6.x86_64 #1 SMP Wed Apr 13 00:51:26 EDT 2016 x86_64 
x86_64 x86_64 GNU/Linux
gcc 4.4.7




reply via email to

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