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