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:[EMAIL PROTECTED]]
Sent: Wednesday, July 21, 1999 5:55 AM
To: Peter Jeremy
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
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 [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message