Results 1 to 6 of 6

Thread: New profile: compress-lzma

  1. #1
    Join Date
    Apr 2008
    Posts
    126

    Default New profile: compress-lzma

    LZMA compression (see http://tukaani.org/lzma/)

    Code:
    diff -Naur a/pts/test-profiles/compress-lzma.xml b/pts/test-profiles/compress-lzma.xml
    --- a/pts/test-profiles/compress-lzma.xml	1970-01-01 01:00:00.000000000 +0100
    +++ b/pts/test-profiles/compress-lzma.xml	2008-06-01 16:12:37.995959111 +0200
    @@ -0,0 +1,18 @@
    +<PhoronixTestSuite>
    +	<TestProfile>
    +		<Version>0.1.0</Version>
    +		<TestType>Processor</TestType>
    +		<SoftwareType>Utility</SoftwareType>
    +		<License>FREE</License>
    +		<Status>VERIFIED</Status>
    +		<Maintainer>apaige</Maintainer>
    +	</TestProfile>
    +	<TestInformation>
    +		<Title>Timed LZMA Compression</Title>
    +		<TimesToRun>3</TimesToRun>
    +		<SubTitle>128MB File Compression</SubTitle>
    +		<ResultScale>Seconds</ResultScale>
    +		<Proportion>LIB</Proportion>
    +		<Description>This test measures the time needed to compress a single 128MB file using LZMA compression.</Description>
    +	</TestInformation>
    +</PhoronixTestSuite>
    diff -Naur a/pts/test-resources/compress-lzma/downloads.xml b/pts/test-resources/compress-lzma/downloads.xml
    --- a/pts/test-resources/compress-lzma/downloads.xml	1970-01-01 01:00:00.000000000 +0100
    +++ b/pts/test-resources/compress-lzma/downloads.xml	2008-06-01 15:53:02.559410319 +0200
    @@ -0,0 +1,8 @@
    +<PhoronixTestSuite>
    +	<Downloads>
    +		<Package>
    +			<URL>http://tukaani.org/lzma/lzma-4.32.6.tar.gz, http://download.snake.de/distfiles/lzma-4.32.6.tar.gz</URL>
    +			<MD5>211d6207fdd7f20eaaae1bbdeb357d3a</MD5>
    +		</Package>
    +	</Downloads>
    +</PhoronixTestSuite>
    diff -Naur a/pts/test-resources/compress-lzma/install.sh b/pts/test-resources/compress-lzma/install.sh
    --- a/pts/test-resources/compress-lzma/install.sh	1970-01-01 01:00:00.000000000 +0100
    +++ b/pts/test-resources/compress-lzma/install.sh	2008-06-01 15:43:42.175664644 +0200
    @@ -0,0 +1,25 @@
    +#!/bin/sh
    +
    +THIS_DIR=$(pwd)
    +mkdir $THIS_DIR/lzma_
    +
    +tar -xzf lzma-4.32.6.tar.gz
    +cd lzma-4.32.6
    +./configure --prefix=$THIS_DIR/lzma_
    +make -j $NUM_CPU_JOBS
    +make install
    +cd ..
    +rm -rf lzma-4.32.6
    +
    +cat > lzma_process <<EOT
    +#!/bin/sh
    +./lzma_/bin/lzma -q -c ./compressfile > /dev/null
    +EOT
    +chmod +x lzma_process
    +
    +
    +cat > compress-lzma <<EOT
    +#!/bin/sh
    +/usr/bin/time -f "LZMA Compress Time: %e Seconds" ./lzma_process 2>&1
    +EOT
    +chmod +x compress-lzma
    diff -Naur a/pts/test-resources/compress-lzma/parse-results.php b/pts/test-resources/compress-lzma/parse-results.php
    --- a/pts/test-resources/compress-lzma/parse-results.php	1970-01-01 01:00:00.000000000 +0100
    +++ b/pts/test-resources/compress-lzma/parse-results.php	2008-06-01 15:43:57.165756036 +0200
    @@ -0,0 +1,5 @@
    +<?php
    +
    +$BENCHMARK_RESULTS = substr($argv[1], strrpos($argv[1], "LZMA Compress Time:") + 19);
    +echo trim(substr($BENCHMARK_RESULTS, 0, strpos($BENCHMARK_RESULTS, "Seconds")));
    +?>
    diff -Naur a/pts/test-resources/compress-lzma/post.sh b/pts/test-resources/compress-lzma/post.sh
    --- a/pts/test-resources/compress-lzma/post.sh	1970-01-01 01:00:00.000000000 +0100
    +++ b/pts/test-resources/compress-lzma/post.sh	2008-06-01 15:37:17.555460588 +0200
    @@ -0,0 +1,4 @@
    +#!/bin/sh
    +
    +cd $1
    +rm -f compressfile
    diff -Naur a/pts/test-resources/compress-lzma/pre.sh b/pts/test-resources/compress-lzma/pre.sh
    --- a/pts/test-resources/compress-lzma/pre.sh	1970-01-01 01:00:00.000000000 +0100
    +++ b/pts/test-resources/compress-lzma/pre.sh	2008-06-01 15:59:30.059055577 +0200
    @@ -0,0 +1,5 @@
    +#!/bin/sh
    +
    +cd $1
    +dd if=/dev/urandom of=compressfile bs=1024 count=131072
    +

  2. #2
    Join Date
    Aug 2007
    Posts
    6,631

    Default

    Why do you need a random generated compressfile? If you want random data you can pipe it directly too...

  3. #3

    Default

    Because this test is ran multiple times, randomly generating it each time may be a waste.

  4. #4
    Join Date
    Apr 2008
    Posts
    126

    Default

    More importantly, simply reading from /dev/urandom already takes a lot of CPU time. It would completely skew results.

  5. #5
    Join Date
    Aug 2007
    Posts
    6,631

    Default

    Also it is not fully known if the input data has to be different to /dev/zero. Try zero and compare the values, input from that is very fast.

  6. #6

    Default

    I had tried that before and it had impacted some tests.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •