From owner-freebsd-hackers Mon Jul 19 16:34:38 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from xylan.com (postal.xylan.com [208.8.0.248]) by hub.freebsd.org (Postfix) with ESMTP id 8580D14D32 for ; Mon, 19 Jul 1999 16:34:33 -0700 (PDT) (envelope-from wes@softweyr.com) Received: from mailhub.xylan.com by xylan.com (8.8.7/SMI-SVR4 (xylan-mgw 2.2 [OUT])) id QAA13252; Mon, 19 Jul 1999 16:29:57 -0700 (PDT) Received: from omni.xylan.com by mailhub.xylan.com (SMI-8.6/SMI-SVR4 (mailhub 2.1 [HUB])) id QAA05070; Mon, 19 Jul 1999 16:29:43 -0700 Received: from softweyr.com (dyn2.utah.xylan.com) by omni.xylan.com (4.1/SMI-4.1 (xylan engr [SPOOL])) id AA04453; Mon, 19 Jul 99 16:29:55 PDT Message-Id: <3793B4F3.1E08C41D@softweyr.com> Date: Mon, 19 Jul 1999 17:29:55 -0600 From: Wes Peters Organization: Softweyr LLC X-Mailer: Mozilla 4.5 [en] (X11; U; FreeBSD 3.1-RELEASE i386) X-Accept-Language: en Mime-Version: 1.0 To: Matthew Dillon Cc: Leif Neland , freebsd-hackers@FreeBSD.ORG Subject: Re: speed of file(1) References: <199907192045.NAA99619@apollo.backplane.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Matthew Dillon wrote: > > Check the size of the magic files on your FreeBSD and Linux boxen. > file was never really designed to be efficient. FreeBSD's magic > file is /usr/share/misc/magic - around 164K. The Linux one 169350 bytes, 4891 lines. The FreeBSD 3.1 magic file is 164223 bytes, 4802 lines. > Leif Neland asked: > > :While trying to port amavis, the virusscanner for mail, > : http://aachalon.de/AMaViS/amavis-0.2.0-pre4.tar.gz ) I noticed it used the > :file(1) several times for each file, and it took rather long time, causing This begs the question "Why?" Can't the program cache the results of file(1) instead of calling it multiple times? Premature optimization is the root of all evil. -- "Where am I, and what am I doing in this handbasket?" Wes Peters Softweyr LLC http://softweyr.com/ wes@softweyr.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message