From nobody Wed Jun 02 18:20:11 2021 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 3C08CE789B4 for ; Wed, 2 Jun 2021 18:20:12 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FwHPm16mLz4Vbb for ; Wed, 2 Jun 2021 18:20:12 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0FA6C1B822 for ; Wed, 2 Jun 2021 18:20:12 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 152IKCvA040261 for ; Wed, 2 Jun 2021 18:20:12 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 152IKC3Y040260 for bugs@FreeBSD.org; Wed, 2 Jun 2021 18:20:12 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 223532] GNU egrep -i is terrible slow if utf-8 locale is enabled Date: Wed, 02 Jun 2021 18:20:11 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: se@FreeBSD.org X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc attachments.created Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D223532 Stefan E=C3=9Fer changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |se@FreeBSD.org --- Comment #4 from Stefan E=C3=9Fer --- 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.=