summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorPhilipp Thomas <pth@suse.de>2016-07-31 21:24:18 +0200
committerPádraig Brady <P@draigBrady.com>2016-08-03 12:35:47 +0100
commit1c17f61ef993a5ee5fb0d3bc47b7b25782ae386c (patch)
treec7cad95c57fcea30076a9afd44935f9b3d2419e9 /scripts
parent5bbce2d2d76edc24caf0888888a1e20cf23151ef (diff)
downloadcoreutils-1c17f61ef993a5ee5fb0d3bc47b7b25782ae386c.tar.xz
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.
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions