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
40
41
| | #!/usr/bin/env bash
test_description='reindexing'
. $(dirname "$0")/perf-test-lib.sh || exit 1
time_start
time_run 'reindex *' "notmuch reindex '*'"
time_run 'reindex *' "notmuch reindex '*'"
time_run 'reindex *' "notmuch reindex '*'"
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`))
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 '*'"
xargs tar cf backup.tar < $manifest
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 '*'"
time_done
|