2019-05-31 11:32:50 -07:00
|
|
|
#!/usr/bin/env bash
|
2012-12-05 21:34:30 -04:00
|
|
|
|
|
|
|
test_description='notmuch new'
|
|
|
|
|
2017-09-25 23:38:20 +03:00
|
|
|
. $(dirname "$0")/perf-test-lib.sh || exit 1
|
2012-12-05 21:34:30 -04:00
|
|
|
|
|
|
|
uncache_database
|
|
|
|
time_start
|
|
|
|
|
2021-05-08 10:57:35 -03:00
|
|
|
manifest=$(mktemp manifestXXXXXX)
|
|
|
|
find mail -type f ! -path 'mail/.notmuch/*' | sed -n '1~4 p' > $manifest
|
|
|
|
xargs tar uf backup.tar < $manifest
|
|
|
|
|
2012-12-05 21:34:30 -04:00
|
|
|
for i in $(seq 2 6); do
|
|
|
|
time_run "notmuch new #$i" 'notmuch new'
|
|
|
|
done
|
|
|
|
|
2019-04-01 07:31:51 -03:00
|
|
|
# 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'
|
|
|
|
|
2021-04-16 09:00:38 -03:00
|
|
|
perl -nle 'unlink $_; unlink $_.copy' $manifest
|
|
|
|
|
|
|
|
time_run "new ($count rm)" 'notmuch new'
|
|
|
|
|
|
|
|
tar xf backup.tar
|
|
|
|
|
|
|
|
time_run "new ($count restore)" 'notmuch new'
|
|
|
|
|
2019-04-01 07:31:51 -03:00
|
|
|
perl -nle 'link $_, "$_.copy"' $manifest
|
|
|
|
|
|
|
|
time_run "new ($count cp)" 'notmuch new'
|
|
|
|
|
2012-12-05 21:34:30 -04:00
|
|
|
time_done
|