From 1c17f61ef993a5ee5fb0d3bc47b7b25782ae386c Mon Sep 17 00:00:00 2001 From: Philipp Thomas Date: Sun, 31 Jul 2016 21:24:18 +0200 Subject: df: improve performance with many mount points Use hash table for seaching in filter_mount_list() and get_dev() This improves performance for 20K mount entries from: real 0m1.731s user 0m0.532s sys 0m1.188s to: real 0m1.066s user 0m0.028s sys 0m1.032s * src/df.c (devlist_table): Define hash table. (devlist_hash): Add hash function. (devlist_compare): Add hash comparison function. (devlist_for_dev): Add lookup function. (devlist_free): Add cleanup function. (filter_mount_list): Use the above hash table. While at it, rename the variable 'devlist' to 'seen_dev' for better readability. (me_for_dev): Use the above lookup function. NEWS: Mention the improvement. THANKS.in: Remove the committer; add original submitter Josef Cejka. --- NEWS | 3 +++ 1 file changed, 3 insertions(+) (limited to 'NEWS') diff --git a/NEWS b/NEWS index 736b95ed6..c0e0d371a 100644 --- a/NEWS +++ b/NEWS @@ -50,6 +50,9 @@ GNU coreutils NEWS -*- outline -*- ** Improvements + df now filters the system mount list more efficiently, with 20000 + mount entries now being processed in about 1.1s compared to 1.7s. + install -Z now also sets the default SELinux context for created directories. stat and tail now know about "prl_fs" (a parallels file system), -- cgit v1.2.3-70-g09d2