Date: Wed, 21 Jul 1999 09:36:16 -0600 From: Charles Randall <crandall@matchlogic.com> To: hackers@FreeBSD.ORG Subject: RE: speed of file(1) Message-ID: <64003B21ECCAD11185C500805F31EC0302D7598C@houston.matchlogic.com>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?64003B21ECCAD11185C500805F31EC0302D7598C>