diff options
author | David Bremner <bremner@debian.org> | 2012-12-03 08:13:31 -0400 |
---|---|---|
committer | David Bremner <bremner@debian.org> | 2012-12-15 08:17:57 -0400 |
commit | 74a883562b3e4593c75fa7625ff5cabab46a6466 (patch) | |
tree | ff339f98d81fc80b53298d73ee2400572a76c2ee /performance-test | |
parent | 925ebd1fde59b003a7215e8cd7e07225a8f8915d (diff) |
perf-test: cache unpacked corpus
Unpacking is not really the expensive step (compared to the initial
notmuch new), but this is a pre-requisite to caching the database.
Diffstat (limited to 'performance-test')
-rw-r--r-- | performance-test/.gitignore | 1 | ||||
-rw-r--r-- | performance-test/Makefile.local | 2 | ||||
-rw-r--r-- | performance-test/perf-test-lib.sh | 51 |
3 files changed, 36 insertions, 18 deletions
diff --git a/performance-test/.gitignore b/performance-test/.gitignore index 53f26973..796ed01e 100644 --- a/performance-test/.gitignore +++ b/performance-test/.gitignore @@ -1 +1,2 @@ tmp.*/ +corpus/ diff --git a/performance-test/Makefile.local b/performance-test/Makefile.local index 5d2acbd7..63e4c3d1 100644 --- a/performance-test/Makefile.local +++ b/performance-test/Makefile.local @@ -29,4 +29,4 @@ $(TXZFILE): download-corpus: wget -O ${TXZFILE} ${DEFAULT_URL} -CLEAN := $(CLEAN) $(dir)/tmp.* +CLEAN := $(CLEAN) $(dir)/tmp.* $(dir)/corpus diff --git a/performance-test/perf-test-lib.sh b/performance-test/perf-test-lib.sh index bdf92449..53ef96da 100644 --- a/performance-test/perf-test-lib.sh +++ b/performance-test/perf-test-lib.sh @@ -39,33 +39,50 @@ add_email_corpus () { rm -rf ${MAIL_DIR} - case "$1" in - --small) - arg="mail/enron/bailey-s" + case "$corpus_size" in + small) + mail_subdir="mail/enron/bailey-s" + check_for="${TEST_DIRECTORY}/corpus/$mail_subdir" ;; - --medium) - arg="mail/notmuch-archive" + medium) + mail_subdir="mail/notmuch-archive" + check_for="${TEST_DIRECTORY}/corpus/$mail_subdir" ;; *) - arg=mail + mail_subdir=mail + check_for="${TEST_DIRECTORY}/corpus/$mail_subdir/enron/wolfe-j" esac - if command -v pixz > /dev/null; then - XZ=pixz - else - XZ=xz + MAIL_CORPUS="${TEST_DIRECTORY}/corpus/$mail_subdir" + args=() + if [ ! -d "$check_for" ] ; then + args+=("notmuch-email-corpus/$mail_subdir") fi - printf "Unpacking corpus\n" - tar --checkpoint=.5000 --extract --strip-components=1 \ - --directory ${TMP_DIRECTORY} \ - --use-compress-program ${XZ} \ - --file ../download/notmuch-email-corpus-${PERFTEST_VERSION}.tar.xz \ - notmuch-email-corpus/"$arg" + if [[ ${#args[@]} > 0 ]]; then + if command -v pixz > /dev/null; then + XZ=pixz + else + XZ=xz + fi + + printf "Unpacking corpus\n" + mkdir -p "${TEST_DIRECTORY}/corpus" + + tar --checkpoint=.5000 --extract --strip-components=1 \ + --directory ${TEST_DIRECTORY}/corpus \ + --use-compress-program ${XZ} \ + --file ../download/notmuch-email-corpus-${PERFTEST_VERSION}.tar.xz \ + "${args[@]}" + + printf "\n" - printf "\n" + fi + + cp -lr $MAIL_CORPUS $MAIL_DIR } + print_header () { printf "[v%4s %6s] Wall(s)\tUsr(s)\tSys(s)\tRes(K)\tIn/Out(512B)\n" \ ${PERFTEST_VERSION} ${corpus_size} |