Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 02 Jun 2021 18:20:11 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 223532] GNU egrep -i is terrible slow if utf-8 locale is enabled
Message-ID:  <bug-223532-227-w1cI9TtIFK@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-223532-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-223532-227@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D223532

Stefan E=C3=9Fer <se@FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |se@FreeBSD.org

--- Comment #4 from Stefan E=C3=9Fer <se@FreeBSD.org> ---
Created attachment 225506
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D225506&action=
=3Dedit
Build with WITH_INTERNAL_NOSPEC for better performance

Building with -DWITH_INTERNAL_NOSPEC makes "fgrep -i" use the internal
implementation of the comparison function instead of regcomp() from the C
library.

The performance impact of using -i with or without UTF-8 is only a factor of
about 3 instead of 100:

$ LANG=3DC time fgrep zpipe /usr/ports/INDEX-14=20
        0.03 real         0.03 user         0.00 sys

$ LANG=3Den_US.UTF-8 time fgrep zpipe /usr/ports/INDEX-14
        0.03 real         0.03 user         0.00 sys

$ LANG=3Den_US.UTF-8 time fgrep -i zpipe /usr/ports/INDEX-14=20
        0.10 real         0.09 user         0.00 sys

$ LANG=3Den_US.UTF-8 time fgrep-ORIG -i zpipe /usr/ports/INDEX-14=20
        4.47 real         4.47 user         0.00 sys

(fgrep has been built with WITH_INTERNAL_NOSPEC, while fgrep-FBSD is a copy=
 of
the original FreeBSD fgrep built without that option.)

Both the original version and the modified version fail the same 4 kyua tes=
ts,
BTW.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-223532-227-w1cI9TtIFK>