unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
blob afa11df8d079f4e3f31c2188173a42d59cb038b8 977 bytes (raw)
name: performance-test/T03-reindex.sh 	 # note: path name is non-authoritative(*)

 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

debug log:

solving afa11df8 ...
found afa11df8 in https://yhetil.org/notmuch/20210424174618.2159866-1-david@tethera.net/
found 8db52a33 in https://yhetil.org/notmuch.git/
preparing index
index prepared:
100755 8db52a33a9e2d8c78ca3720bad83ebfceea07079	performance-test/T03-reindex.sh

applying [1/1] https://yhetil.org/notmuch/20210424174618.2159866-1-david@tethera.net/
diff --git a/performance-test/T03-reindex.sh b/performance-test/T03-reindex.sh
index 8db52a33..afa11df8 100755

Checking patch performance-test/T03-reindex.sh...
Applied patch performance-test/T03-reindex.sh cleanly.

index at:
100755 afa11df8d079f4e3f31c2188173a42d59cb038b8	performance-test/T03-reindex.sh

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).