X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=performance-test%2FT03-reindex.sh;h=b58950d72b606927f36ec116357f8f456b907a98;hb=8cb30b08d8c9a650b8b5a98f4547b1b48e3f9d03;hp=7af2d22d3df869d92b8658a289d7e66cffff6c94;hpb=e5beec39d6021c7b8c21e6d84050660ad6c69a96;p=notmuch diff --git a/performance-test/T03-reindex.sh b/performance-test/T03-reindex.sh index 7af2d22d..b58950d7 100755 --- a/performance-test/T03-reindex.sh +++ b/performance-test/T03-reindex.sh @@ -1,8 +1,8 @@ -#!/bin/bash +#!/usr/bin/env bash -test_description='tagging' +test_description='reindexing' -. ./perf-test-lib.sh || exit 1 +. $(dirname "$0")/perf-test-lib.sh || exit 1 time_start @@ -10,4 +10,32 @@ 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`)) + +xargs tar uf backup.tar < $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 '*'" + +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