NetBSD-Bugs archive

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

bin/53241: grep(1) is too slow in multibyte locale environments



>Number:         53241
>Category:       bin
>Synopsis:       grep(1) is too slow in multibyte locale environments
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue May 01 04:30:02 +0000 2018
>Originator:     Takeshi Nakayama
>Release:        NetBSD 8.0_RC1
>Organization:
Private
>Environment:
System: NetBSD nyx 8.0_RC1 NetBSD 8.0_RC1 (NYX32) #0:
 Fri Apr 20 04:19:57 JST 2018 takeshi@nyx:/sys/arch/sparc64/compile/NYX32 sparc64
Architecture: sparc
Machine: sparc64
>Description:
Wide char support of grep(1) is enabled when grep was moved to
external/gpl2/grep.  Since then, grep is too slow in multibyte
locale environments.

I noticed it since updating to 8.0_RC1.

>How-To-Repeat:
$ ls -l /etc/mtree/set.base
-rw-r--r--  1 root  wheel  842084 Apr 22 02:44 /etc/mtree/set.base
$ LC_CTYPE=C time grep uname=root /etc/mtree/set.base >/dev/null
        0.04 real         0.02 user         0.00 sys
$ LC_CTYPE=ja_JP.eucJP time grep uname=root /etc/mtree/set.base >/dev/null
       39.98 real        38.08 user         0.03 sys
$ LC_CTYPE=ja_JP.UTF-8 time grep uname=root /etc/mtree/set.base >/dev/null
       42.70 real        40.97 user         0.00 sys

>Fix:
Possible fix candidates are:

- disable wide char support
- provide switch to enable/disable wide char support (default is disable)
- import newer version of GNU grep (but GPLv3)



Home | Main Index | Thread Index | Old Index