From owner-freebsd-hackers@FreeBSD.ORG Sat Jun 19 03:55:03 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3849C106564A for ; Sat, 19 Jun 2010 03:55:03 +0000 (UTC) (envelope-from peterjeremy@acm.org) Received: from mail13.syd.optusnet.com.au (mail13.syd.optusnet.com.au [211.29.132.194]) by mx1.freebsd.org (Postfix) with ESMTP id C051C8FC14 for ; Sat, 19 Jun 2010 03:55:02 +0000 (UTC) Received: from server.vk2pj.dyndns.org (c211-30-160-13.belrs4.nsw.optusnet.com.au [211.30.160.13]) by mail13.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o5J3swNG023967 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 19 Jun 2010 13:54:59 +1000 X-Bogosity: Ham, spamicity=0.000000 Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by server.vk2pj.dyndns.org (8.14.4/8.14.4) with ESMTP id o5J3sv3K025621; Sat, 19 Jun 2010 13:54:57 +1000 (EST) (envelope-from peter@server.vk2pj.dyndns.org) Received: (from peter@localhost) by server.vk2pj.dyndns.org (8.14.4/8.14.4/Submit) id o5J3svMa025620; Sat, 19 Jun 2010 13:54:57 +1000 (EST) (envelope-from peter) Date: Sat, 19 Jun 2010 13:54:57 +1000 From: Peter Jeremy To: freebsd-hackers@freebsd.org, file@mx.gw.com Message-ID: <20100619035457.GA63510@server.vk2pj.dyndns.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="BOKacYhQ+x31HxR3" Content-Disposition: inline X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Subject: Poor file(1) performance X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jun 2010 03:55:03 -0000 --BOKacYhQ+x31HxR3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable I recently had reason to run file(1) (file-5.03 on FreeBSD 8-stable) on a large number of files and felt the performance wasn't up to par. When I investigated further, I found that about 95% of the runtime related to the two regex's to recognize REXX files: # OS/2 batch files are REXX. the second regex is a bit generic, oh well # the matched commands seem to be common in REXX and uncommon elsewhere 100 regex/c =3D^[\ \t]{0,10}call[\ \t]{1,10}rxfunc OS/2 REXX batch file text 100 regex/c =3D^[\ \t]{0,10}say\ ['"] OS/2 REXX batch file text Since REXX files are not present in my environment, I can avoid the issue by just commenting out the offending lines. Someone with more expertise in magic(5) might be able to suggest a better fix. --=20 Peter Jeremy --BOKacYhQ+x31HxR3 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkwcP5EACgkQ/opHv/APuIewSgCcDVrNVUEwmNakzKpRvMEFlWkh QgsAnjpvKCYtn1nYbzXdiFfU+rEQzFTY =BXDH -----END PGP SIGNATURE----- --BOKacYhQ+x31HxR3--