]> git.notmuchmail.org Git - notmuch/blob - performance-test/T00-new.sh
emacs: Add new option notmuch-search-hide-excluded
[notmuch] / performance-test / T00-new.sh
1 #!/usr/bin/env bash
2
3 test_description='notmuch new'
4
5 . $(dirname "$0")/perf-test-lib.sh || exit 1
6
7 uncache_database
8 time_start
9
10 manifest=$(mktemp manifestXXXXXX)
11 find mail -type f ! -path 'mail/.notmuch/*' | sed -n '1~4 p' > $manifest
12 xargs tar uf backup.tar < $manifest
13
14 for i in $(seq 2 6); do
15     time_run "notmuch new #$i" 'notmuch new'
16 done
17
18 # arithmetic context is to eat extra whitespace on e.g. some BSDs
19 count=$((`wc -l < $manifest`))
20
21 perl -nle 'rename $_, "$_.renamed"' $manifest
22
23 time_run "new ($count mv)" 'notmuch new'
24
25 perl -nle 'rename "$_.renamed", $_' $manifest
26
27 time_run "new ($count mv back)" 'notmuch new'
28
29 perl -nle 'unlink $_; unlink $_.copy' $manifest
30
31 time_run "new ($count rm)" 'notmuch new'
32
33 tar xf backup.tar
34
35 time_run "new ($count restore)" 'notmuch new'
36
37 perl -nle 'link $_, "$_.copy"' $manifest
38
39 time_run "new ($count cp)" 'notmuch new'
40
41 time_done