bug-grep
[Top][All Lists]
Advanced

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

bug#16232: [PATCH] grep: make --ignore-case (-i) faster (sometimes 10x)


From: Jim Meyering
Subject: bug#16232: [PATCH] grep: make --ignore-case (-i) faster (sometimes 10x) in multibyte locales
Date: Wed, 19 Feb 2014 11:17:16 -0800

On Wed, Feb 19, 2014 at 6:22 AM, Norihiro Tanaka <address@hidden> wrote:
> for i in $(seq 10); do env LC_ALL=ja_JP.eucJP time src/grep -i n in; done

Wow.  You're right.  With the attached patch, I see a speedup of more
than 130x in this case: (fyi, the "time" output is slightly different,
because I have installed GNU time)

grep-2.17$ for i in $(seq 5); do env LC_ALL=ja_JP.eucJP time grep -i n in; done
        2.78 real         2.78 user         0.00 sys
        2.73 real         2.73 user         0.00 sys
        2.75 real         2.75 user         0.00 sys
        2.73 real         2.73 user         0.00 sys
        2.74 real         2.74 user         0.00 sys

2.17+patch$ for i in $(seq 5); do env LC_ALL=ja_JP.eucJP time src/grep
-i n in; done
        0.02 real         0.02 user         0.00 sys
        0.02 real         0.02 user         0.00 sys
        0.02 real         0.02 user         0.00 sys
        0.02 real         0.02 user         0.00 sys
        0.02 real         0.02 user         0.00 sys

I haven't investigated they "why" yet, but expect that I will make
grep-2.18 with just this one performance-improving patch.

Thank you, Norihiro,

Jim

Attachment: k.txt
Description: Text document


reply via email to

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