3 test_description='notmuch new'
5 . $(dirname "$0")/perf-test-lib.sh || exit 1
10 manifest=$(mktemp manifestXXXXXX)
11 find mail -type f ! -path 'mail/.notmuch/*' | sed -n '1~4 p' > $manifest
12 xargs tar uf backup.tar < $manifest
14 for i in $(seq 2 6); do
15 time_run "notmuch new #$i" 'notmuch new'
18 # arithmetic context is to eat extra whitespace on e.g. some BSDs
19 count=$((`wc -l < $manifest`))
21 perl -nle 'rename $_, "$_.renamed"' $manifest
23 time_run "new ($count mv)" 'notmuch new'
25 perl -nle 'rename "$_.renamed", $_' $manifest
27 time_run "new ($count mv back)" 'notmuch new'
29 perl -nle 'unlink $_; unlink $_.copy' $manifest
31 time_run "new ($count rm)" 'notmuch new'
35 time_run "new ($count restore)" 'notmuch new'
37 perl -nle 'link $_, "$_.copy"' $manifest
39 time_run "new ($count cp)" 'notmuch new'