Running the file(1) command on a 7 MB text file takes much longer in 10.2 than in 10.1. Example: # ll /tmp/x6 -rw-r--r-- 1 root wheel 7384414 Sep 5 10:30 /tmp/x6 # file /tmp/x6 /tmp/x6: ASCII text file /tmp/x6 26.12s user 0.00s system 99% cpu 26.237 total # I have this on all my machines since installing 10.2. Any ideas on what is wrong? -- Martin
05.09.2015 15:53, Martin Birgmeier ?????:> Running the file(1) command on a 7 MB text file takes much longer in > 10.2 than in 10.1. > > Example: > > # ll /tmp/x6 > -rw-r--r-- 1 root wheel 7384414 Sep 5 10:30 /tmp/x6 > # file /tmp/x6 > /tmp/x6: ASCII text > file /tmp/x6 26.12s user 0.00s system 99% cpu 26.237 total > # > > I have this on all my machines since installing 10.2. > > Any ideas on what is wrong?That's performance regression in the file-5.23 compared with file-5.22 bundled with earlier versions of FreeBSD. I have reported it upstream about 3 weeks ago but got no response: http://bugs.gw.com/view.php?id=474 For me, 5.23 is 130+ times slower than 5.22. Partially that's because of larger look-ahead buffer (1MB vs. 256K): https://github.com/file/file/commit/dd89d293fe62ca55542a5637e239b33404c58a8d However, backout of this change gets only 10 times speedup, not 130 times, so there should be more changes guilty. Eugene Grosbein
On Sat, Sep 05, 2015 at 10:53:33AM +0200, Martin Birgmeier wrote:> Running the file(1) command on a 7 MB text file takes much longer in > 10.2 than in 10.1. > > Example: > > # ll /tmp/x6 > -rw-r--r-- 1 root wheel 7384414 Sep 5 10:30 /tmp/x6 > # file /tmp/x6 > /tmp/x6: ASCII text > file /tmp/x6 26.12s user 0.00s system 99% cpu 26.237 total > # > > I have this on all my machines since installing 10.2. > > Any ideas on what is wrong?I've found the change to libmagic that brought this. Please try temporary workaround if you have sources installed: cd /tmp fetch http://www.grosbein.net/file/patch-softmagic.c cd /usr/src/contrib/file patch -R < /tmp/patch-softmagic.c cd /usr/src/lib/libmagic make obj clean depend && make all install Eugene Grosbein
05.09.2015 15:53, Martin Birgmeier ?????:> Running the file(1) command on a 7 MB text file takes much longer in > 10.2 than in 10.1. > > Example: > > # ll /tmp/x6 > -rw-r--r-- 1 root wheel 7384414 Sep 5 10:30 /tmp/x6 > # file /tmp/x6 > /tmp/x6: ASCII text > file /tmp/x6 26.12s user 0.00s system 99% cpu 26.237 total > # > > I have this on all my machines since installing 10.2.The problem is now fixed upstream libmagic code repository but we'll have to wait for file-5.25 release. I've extracted official code fix from its repository, apply as following: fetch http://www.grosbein.net/file/patch-regexmax.diff cd /usr/src patch < /path/to/patch-regexmax.diff cd lib/libmagic make obj depend && make all install
Hello, Xin LI! Please take a look at this problem in file(1): http://bugs.gw.com/view.php?id=474 Can we import upstream fix for this soon? 05.09.2015 15:53, Martin Birgmeier wrote:> Running the file(1) command on a 7 MB text file takes much longer in > 10.2 than in 10.1. > > Example: > > # ll /tmp/x6 > -rw-r--r-- 1 root wheel 7384414 Sep 5 10:30 /tmp/x6 > # file /tmp/x6 > /tmp/x6: ASCII text > file /tmp/x6 26.12s user 0.00s system 99% cpu 26.237 total > # > > I have this on all my machines since installing 10.2.