2019-05-31 11:32:50 -07:00
|
|
|
#!/usr/bin/env bash
|
2017-06-04 09:32:35 -03:00
|
|
|
|
2019-03-29 08:26:47 -03:00
|
|
|
test_description='reindexing'
|
2017-06-04 09:32:35 -03:00
|
|
|
|
2017-09-25 23:38:20 +03:00
|
|
|
. $(dirname "$0")/perf-test-lib.sh || exit 1
|
2017-06-04 09:32:35 -03:00
|
|
|
|
|
|
|
time_start
|
|
|
|
|
|
|
|
time_run 'reindex *' "notmuch reindex '*'"
|
|
|
|
time_run 'reindex *' "notmuch reindex '*'"
|
|
|
|
time_run 'reindex *' "notmuch reindex '*'"
|
|
|
|
|
2021-04-24 14:46:18 -03:00
|
|
|
manifest=$(mktemp manifestXXXXXX)
|
|
|
|
|
|
|
|
find mail -type f ! -path 'mail/.notmuch/*' | sed -n '1~4 p' > $manifest
|
|
|
|
# arithmetic context is to eat extra whitespace on e.g. some BSDs
|
|
|
|
count=$((`wc -l < $manifest`))
|
|
|
|
|
|
|
|
xargs tar uf backup.tar < $manifest
|
|
|
|
|
|
|
|
perl -nle 'rename $_, "$_.renamed"' $manifest
|
|
|
|
|
|
|
|
time_run "reindex ($count mv)" "notmuch reindex '*'"
|
|
|
|
|
|
|
|
perl -nle 'rename "$_.renamed", $_' $manifest
|
|
|
|
|
|
|
|
time_run "reindex ($count mv back)" "notmuch reindex '*'"
|
|
|
|
|
|
|
|
perl -nle 'unlink $_; unlink $_.copy' $manifest
|
|
|
|
|
|
|
|
time_run "reindex ($count rm)" "notmuch reindex '*'"
|
|
|
|
|
|
|
|
tar xf backup.tar
|
|
|
|
|
|
|
|
time_run "reindex ($count restore)" "notmuch reindex '*'"
|
|
|
|
|
|
|
|
perl -nle 'link $_, "$_.copy"' $manifest
|
|
|
|
|
|
|
|
time_run "reindex ($count cp)" "notmuch reindex '*'"
|
|
|
|
|
2017-06-04 09:32:35 -03:00
|
|
|
time_done
|