Bug 203116 - /usr/bin/file: very slow processes large text files
Summary: /usr/bin/file: very slow processes large text files
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 10.2-RELEASE
Hardware: amd64 Any
: --- Affects Many People
Assignee: Xin LI
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-15 06:54 UTC by Vladimir Omelchuk
Modified: 2016-03-25 11:42 UTC (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Omelchuk 2015-09-15 06:54:39 UTC
/usr/bin/file from base very slow processes large text files (for example in Midnight Commander).

After removed /usr/bin/file and create link to /usr/local/bin/file (install from ports sysutils/file), MC again quickly open large files.

Timing for /usr/bin/file:
# time file /usr/ports/UPDATING 
/usr/ports/UPDATING: ASCII text
13.811u 0.007s 0:13.84 99.7%	20+173k 0+0io 0pf+0w

Timing for /usr/local/bin/file:
# time file /usr/ports/UPDATING 
/usr/ports/UPDATING: ASCII text
0.247u 0.000s 0:00.24 100.0%	20+175k 0+0io 0pf+0w

# uname -srm
FreeBSD 10.2-RELEASE-p2 amd64

# less make.conf 
#BATCH=YES
#FORCE_PKG_REGISTER=YES
CPUTYPE?=core2
OPTIONS_SET=CUPS
WITHOUT_LPR=YES
DEFAULT_VERSIONS+=apache=2.2
QT4_OPTIONS=CUPS NAS QGTKSTYLE
LOCALIZED_LANG=ru
DEFAULT_VERSIONS+=perl5=5.18

Detail: https://forums.freebsd.org/threads/usr-bin-file-works-very-slow.52958/
Comment 1 v.chernyadev 2015-10-23 14:07:31 UTC
The problem is in /usr/share/misc/magic.
I replaced /usr/share/misc/magic* from older release and now it works fast.
Comment 2 Vladimir Omelchuk 2015-10-27 14:47:22 UTC
What version FreeBSD you are used for replaced /usr/share/misc/magic*?
Comment 3 Vladimir Omelchuk 2015-10-28 09:34:09 UTC
Even, if replaced files in /usr/share/misc/magic*,
this problem in the base system and it is not solved.
Comment 4 Xin LI freebsd_committer freebsd_triage 2016-02-27 17:49:51 UTC
+re@ and secteam@

I think this is http://bugs.gw.com/view.php?id=474 and was fixed in later file imports (thus 10.3-RELEASE which is shipped with file 5.25).

It's not yet clear to me if this warrants an EN (as it's only complained by very few people), though, but that's an option.
Comment 5 Vladimir Omelchuk 2016-03-03 12:54:53 UTC
Waiting fix in the 10.3-RELEASE ...
Comment 6 Vladimir Omelchuk 2016-03-05 01:04:16 UTC
<uname>
FreeBSD 10.3-RC1 amd64

Timing for /usr/bin/file:
# time file /usr/ports/UPDATING
/usr/ports/UPDATING: ASCII text
0.214u 0.000s 0:00.21 100.0%	21+181k 2+0io 0pf+0w

/usr/bin/file working is fine!
Thanks!
Comment 7 Vladimir Omelchuk 2016-03-25 10:34:50 UTC
<uname>
FreeBSD 10.3-RELEASE amd64

Problem solved.
PR can be closed.
Comment 8 Ed Maste freebsd_committer freebsd_triage 2016-03-25 11:42:16 UTC
Confirmed fixed by the submitter