Subject: bug#31074: Grep -i is slow

From: Geoff Kuenning <[email-masked]>
Date: Sun, 08 Apr 2018 21:56:25 -0700

Nice catch!  It looks like I'm running grep 2.16.  No clue why my 
distro is more than four years behind.  I'll whine at them.  In 
the meantime, let's close this bug; I can reopen it in the 
unlikely event that it's still there when I get around to 
upgrading.

> It sounds like you've run into a bug that was fixed in grep 2.18
> (2014-02-20). Please try grep 3.1, the current version. If that
> doesn't work, it'd be helpful if you could give us a 
> reproducible test
> case. Here's how I tried (and failed) to reproduce the problem 
> on
> Fedora 27 x86-64, which has grep 3.1:
>
> $ shuf -i 1-20000000 >rawindex
> $ ls -l rawindex
> -rw-r--r--. 1 eggert eggert 168888897 Apr  6 12:30 rawindex
> $ time grep outgoing.*harris.*dcraw rawindex
>
> real    0m0.069s
> user    0m0.013s
> sys     0m0.055s
> $ time grep -i outgoing.*harris.*dcraw rawindex
>
> real    0m0.418s
> user    0m0.368s
> sys     0m0.048s
> $ time grep
> [Oo][Uu][Tt][Gg][Oo][Ii][Nn][Gg].*[Hh][Aa][Rr][Rr][Ii][Ss].*[Dd][Cc][Rr][Aa][Ww]'
> rawindex
>
> real    0m0.416s
> user    0m0.357s
> sys     0m0.058s
> $ locale
> LANG=en_US.UTF-8
> LC_CTYPE="en_US.UTF-8"
> LC_NUMERIC="en_US.UTF-8"
> LC_TIME="en_US.UTF-8"
> LC_COLLATE="en_US.UTF-8"
> LC_MONETARY="en_US.UTF-8"
> LC_MESSAGES="en_US.UTF-8"
> LC_PAPER="en_US.UTF-8"
> LC_NAME="en_US.UTF-8"
> LC_ADDRESS="en_US.UTF-8"
> LC_TELEPHONE="en_US.UTF-8"
> LC_MEASUREMENT="en_US.UTF-8"
> LC_IDENTIFICATION="en_US.UTF-8"
> LC_ALL=
>

-- 
    Geoff Kuenning   [email-masked] 
    http://www.cs.hmc.edu/~geoff/

I have always wished for my computer to be as easy to use as my
telephone; my wish has come true because I can no longer figure 
out
how to use my telephone.
		-- Bjarne Stroustrup