From owner-freebsd-hackers Wed Jul 21 8:36:34 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from houston.matchlogic.com (houston.matchlogic.com [205.216.147.127]) by hub.freebsd.org (Postfix) with ESMTP id 55219154CE for ; Wed, 21 Jul 1999 08:36:21 -0700 (PDT) (envelope-from crandall@matchlogic.com) Received: by houston.matchlogic.com with Internet Mail Service (5.5.2448.0) id ; Wed, 21 Jul 1999 09:36:17 -0600 Message-ID: <64003B21ECCAD11185C500805F31EC0302D7598C@houston.matchlogic.com> From: Charles Randall To: hackers@FreeBSD.ORG Subject: RE: speed of file(1) Date: Wed, 21 Jul 1999 09:36:16 -0600 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2448.0) Content-Type: text/plain; charset="iso-8859-1" Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG When this gets committed, can it be applied to both the 3.x and 4.x trees? Thanks, Charles -----Original Message----- From: Peter Edwards [mailto:peter.edwards@isocor.ie] Sent: Wednesday, July 21, 1999 5:55 AM To: Peter Jeremy Cc: will@iki.fi; hackers@FreeBSD.ORG Subject: Re: speed of file(1) A quick look at the source reveals: A MAXMAGIS constant in file.h that estimates a limit of 1000 lines in magic. (The real number is 4802) An array sized on MAXMAGIS, that is reallocated every ALLOC_INTR lines of magic once MAXMAGIS is exceeded. The patch updates MAXMAGIS to 5000 (give a bit of room to grow) And makes ALLOC_INCR a variable that is bigger, and doubles every time it is used, to attenuate the problem if there ever ends up being 10000 entries in magic. Results on a 90Mhz Pentium: new verson time ./file ./file ./file: FreeBSD/i386 compact demand paged dynamically linked executable not stripped 0.14 real 0.11 user 0.02 sys old verson: ./file: FreeBSD/i386 compact demand paged dynamically linked executable not stripped 0.79 real 0.60 user 0.16 sys -- Peter. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message