]> git.notmuchmail.org Git - notmuch/blob - performance-test/T03-reindex.sh
emacs: Add new option notmuch-search-hide-excluded
[notmuch] / performance-test / T03-reindex.sh
1 #!/usr/bin/env bash
2
3 test_description='reindexing'
4
5 . $(dirname "$0")/perf-test-lib.sh || exit 1
6
7 time_start
8
9 time_run 'reindex *' "notmuch reindex '*'"
10 time_run 'reindex *' "notmuch reindex '*'"
11 time_run 'reindex *' "notmuch reindex '*'"
12
13 manifest=$(mktemp manifestXXXXXX)
14
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`))
18
19 xargs tar uf backup.tar < $manifest
20
21 perl -nle 'rename $_, "$_.renamed"' $manifest
22
23 time_run "reindex ($count mv)" "notmuch reindex '*'"
24
25 perl -nle 'rename "$_.renamed", $_' $manifest
26
27 time_run "reindex ($count mv back)" "notmuch reindex '*'"
28
29 perl -nle 'unlink $_; unlink $_.copy' $manifest
30
31 time_run "reindex ($count rm)" "notmuch reindex '*'"
32
33 tar xf backup.tar
34
35 time_run "reindex ($count restore)" "notmuch reindex '*'"
36
37 perl -nle 'link $_, "$_.copy"' $manifest
38
39 time_run "reindex ($count cp)" "notmuch reindex '*'"
40
41 time_done