Poor file(1) performance

Peter Jeremy peterjeremy at acm.org
Sat Jun 19 03:55:03 UTC 2010


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 =^[\ \t]{0,10}call[\ \t]{1,10}rxfunc OS/2 REXX batch file text
100	regex/c =^[\ \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.

-- 
Peter Jeremy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20100619/df0c5b7a/attachment.pgp


More information about the freebsd-hackers mailing list