File: T00-new.sh

package info (click to toggle)
notmuch 0.39-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 7,104 kB
  • sloc: sh: 21,888; ansic: 14,897; lisp: 9,061; cpp: 7,990; python: 6,221; perl: 391; makefile: 231; javascript: 34; ruby: 13
file content (41 lines) | stat: -rwxr-xr-x 879 bytes parent folder | download | duplicates (3)
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='notmuch new'

. $(dirname "$0")/perf-test-lib.sh || exit 1

uncache_database
time_start

manifest=$(mktemp manifestXXXXXX)
find mail -type f ! -path 'mail/.notmuch/*' | sed -n '1~4 p' > $manifest
xargs tar uf backup.tar < $manifest

for i in $(seq 2 6); do
    time_run "notmuch new #$i" 'notmuch new'
done

# arithmetic context is to eat extra whitespace on e.g. some BSDs
count=$((`wc -l < $manifest`))

perl -nle 'rename $_, "$_.renamed"' $manifest

time_run "new ($count mv)" 'notmuch new'

perl -nle 'rename "$_.renamed", $_' $manifest

time_run "new ($count mv back)" 'notmuch new'

perl -nle 'unlink $_; unlink $_.copy' $manifest

time_run "new ($count rm)" 'notmuch new'

tar xf backup.tar

time_run "new ($count restore)" 'notmuch new'

perl -nle 'link $_, "$_.copy"' $manifest

time_run "new ($count cp)" 'notmuch new'

time_done