]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Speed up hardlink detection by using a self-sizing hash
authorkientzle <kientzle@FreeBSD.org>
Fri, 30 Apr 2004 18:17:51 +0000 (18:17 +0000)
committerkientzle <kientzle@FreeBSD.org>
Fri, 30 Apr 2004 18:17:51 +0000 (18:17 +0000)
commit5aa078d988a3268f00120c1b3bbdbdab9ddc6b2f
tree032e33c8daae2f2ab11522f62c513645bd21fb04
parentf251d164a58a27d078136fb7693a8a19b6a79c39
Speed up hardlink detection by using a self-sizing hash
table rather than the old linear list search.

On my "hardlink detection torture test", this reduced
user time from 4700 seconds down to 4.2 seconds
and wallclock time from 1:24:48 down to 1:08.
(Yes, that's over one THOUSAND times reduction in user time. ;-)
In the worst case, the new code doubles peak memory usage,
though it could actually reduce memory usage in many cases.

MFC after: 1 week
PR: misc/42167, bin/51151
usr.bin/du/du.c