25 echo "error: unknown performance test option '$1'" >&2; exit 1 ;;
28 . ../test/test-lib-common.sh
32 if ! test -x ../notmuch
34 echo >&2 'You do not seem to have built notmuch yet.'
38 DB_CACHE_DIR=${TEST_DIRECTORY}/notmuch.cache.$corpus_size
44 case "$corpus_size" in
46 mail_subdir="mail/enron/bailey-s"
47 check_for="${TEST_DIRECTORY}/corpus/$mail_subdir"
50 mail_subdir="mail/notmuch-archive"
51 check_for="${TEST_DIRECTORY}/corpus/$mail_subdir"
55 check_for="${TEST_DIRECTORY}/corpus/$mail_subdir/enron/wolfe-j"
58 MAIL_CORPUS="${TEST_DIRECTORY}/corpus/$mail_subdir"
60 if [ ! -d "$check_for" ] ; then
61 args+=("notmuch-email-corpus/$mail_subdir")
64 if [[ ${#args[@]} > 0 ]]; then
65 if command -v pixz > /dev/null; then
71 printf "Unpacking corpus\n"
72 mkdir -p "${TEST_DIRECTORY}/corpus"
74 tar --checkpoint=.5000 --extract --strip-components=1 \
75 --directory ${TEST_DIRECTORY}/corpus \
76 --use-compress-program ${XZ} \
77 --file ../download/notmuch-email-corpus-${PERFTEST_VERSION}.tar.xz \
84 cp -lr $MAIL_CORPUS $MAIL_DIR
94 if [ -d $DB_CACHE_DIR ]; then
95 cp -r $DB_CACHE_DIR ${MAIL_DIR}/.notmuch
97 time_run 'Initial notmuch new' "notmuch new"
103 if [ -d $MAIL_DIR/.notmuch ]; then
104 cp -r $MAIL_DIR/.notmuch $DB_CACHE_DIR
106 echo "Warning: No database found to cache"
110 uncache_database () {
115 printf "[v%4s %6s] Wall(s)\tUsr(s)\tSys(s)\tRes(K)\tIn/Out(512B)\n" \
116 ${PERFTEST_VERSION} ${corpus_size}
121 if test "$verbose" != "t"; then exec 4>test.output 3>&4; fi
122 if ! eval >&3 "/usr/bin/time -f '%e\t%U\t%S\t%M\t%I/%O' $2" ; then
123 test_failure=$(($test_failure + 1))
130 if [ "$test_failure" = "0" ]; then
138 cd -P "$test" || error "Cannot setup test environment"
142 echo $(basename "$0"): "Testing ${test_description:-notmuch performance}"