-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbench.sh
executable file
·39 lines (35 loc) · 925 Bytes
/
bench.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env bash
# ddh produces a Results.txt file after each run
#
# rmlint produces a number of files all named rmlint.{ext}
#
# fclones and jdupes both don't scan recursively by default
#
# dupe-krill skips file smaller than the block size, hence the -s flag,
# and will hardlinks files together, hence the --dry-run flag
#
# fddf ignores zero length files
case "$1" in
"cold")
prepare_cmd='rm Results.txt rmlint.* || true && echo "free && sync && echo 3 > /proc/sys/vm/drop_caches && free" | sudo sh'
warmups=0
;;
*)
prepare_cmd="rm Results.txt rmlint.* || true"
warmups=5
;;
esac
hyperfine --warmup "$warmups" \
--min-runs 10 \
--export-markdown export.md \
--prepare "$prepare_cmd" \
"fclones --min-size 0 -R ~" \
"jdupes -z -r ~" \
"rmlint --hidden ~" \
"ddh ~" \
"dupe-krill -s -d ~" \
"fddf -m 0 ~" \
"yadf ~"
{
rm Results.txt rmlint.* || true
} 2> /dev/null