[PATCH 3/4] perf-test: unpack tags.

Austin Clements aclements at csail.mit.edu
Tue Dec 4 21:23:22 PST 2012


On Mon, 03 Dec 2012, david at tethera.net wrote:
> From: David Bremner <bremner at debian.org>
>
> It's a bit annoying to call tar twice, but we cache the results so it
> isn't as bad as it could be.
> ---
>  performance-test/Makefile.local   |    1 +
>  performance-test/perf-test-lib.sh |   25 +++++++++++++++++++------
>  2 files changed, 20 insertions(+), 6 deletions(-)
>
> diff --git a/performance-test/Makefile.local b/performance-test/Makefile.local
> index b136a88..cdd7f19 100644
> --- a/performance-test/Makefile.local
> +++ b/performance-test/Makefile.local
> @@ -30,3 +30,4 @@ download-corpus:
>  	wget -O ${TXZFILE} ${DEFAULT_URL}
>  
>  CLEAN := $(CLEAN) $(dir)/tmp.* $(dir)/corpus.mail.* $(dir)/notmuch.cache.*
> +CLEAN := $(CLEAN) $(dir)/corpus.tags
> diff --git a/performance-test/perf-test-lib.sh b/performance-test/perf-test-lib.sh
> index 08e2ebd..40c88c9 100644
> --- a/performance-test/perf-test-lib.sh
> +++ b/performance-test/perf-test-lib.sh
> @@ -41,6 +41,13 @@ DB_CACHE_DIR=${TEST_DIRECTORY}/notmuch.cache.$corpus_size
>  add_email_corpus ()
>  {
>      rm -rf ${MAIL_DIR}
> +
> +    if command -v pixz > /dev/null; then
> +	XZ=pixz
> +    else
> +	XZ=xz
> +    fi
> +
>      if [ ! -d $CORPUS_DIR ]; then
>  	case "$corpus_size" in
>  	    small)
> @@ -53,12 +60,6 @@ add_email_corpus ()
>  		arg=mail
>  	esac
>  
> -	if command -v pixz > /dev/null; then
> -	    XZ=pixz
> -	else
> -	    XZ=xz
> -	fi
> -
>  	printf "Unpacking corpus\n"
>  	mkdir $CORPUS_DIR
>  
> @@ -72,6 +73,18 @@ add_email_corpus ()
>  
>      fi
>  
> +    if [ ! -d $TEST_DIRECTORY/corpus.tags ]; then
> +
> +	mkdir $TEST_DIRECTORY/corpus.tags
> +
> +	tar --extract --strip-components=2 \
> +	    --directory $TEST_DIRECTORY/corpus.tags \
> +	    --use-compress-program ${XZ} \
> +	    --file ../download/notmuch-email-corpus-${PERFTEST_VERSION}.tar.xz \
> +	    notmuch-email-corpus/tags

Why not --strip-components=1 and unpack both mail/ and tags/ into a
single, shared corpus cache directory in one call to tar?  Since you're
going to cp -lr things anyway, you can structure the corpus cache
however is convenient.

> +    fi
> +
> +    cp -lr $TEST_DIRECTORY/corpus.tags $TMP_DIRECTORY
>      cp -lr $CORPUS_DIR $MAIL_DIR
>  
>      if [ -d $DB_CACHE_DIR ]; then
> -- 
> 1.7.10.4
>
> _______________________________________________
> notmuch mailing list
> notmuch at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch


More information about the notmuch mailing list