Fix display of benchmarks in README (#165)

This commit is contained in:
Josh Holmer 2019-02-04 10:03:58 -05:00 committed by GitHub
parent 6430166ec9
commit b18414ba8c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View file

@ -97,7 +97,7 @@ Oxipng is open-source software, distributed under the MIT license.
Tested oxipng 2.2.0 (compiled on rustc 1.32.0 (9fda7c223 2019-01-16)) against OptiPNG version 0.7.7 on Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz with 8 logical cores
```
Benchmark #1: ./target/release/oxipng -P ./tests/files/rgb_16_should_be_grayscale_8.png
Time (mean ± σ): 117.2 ms ± 5.6 ms [User: 269.2 ms, System: 17.2 ms]
Range (min … max): 106.6 ms … 126.0 ms 25 runs
@ -109,6 +109,8 @@ Benchmark #2: optipng -simulate ./tests/files/rgb_16_should_be_grayscale_8.png
Summary
'./target/release/oxipng -P ./tests/files/rgb_16_should_be_grayscale_8.png' ran
2.39 ± 0.12 times faster than 'optipng -simulate ./tests/files/rgb_16_should_be_grayscale_8.png'
Benchmark #1: ./target/release/oxipng -o4 -P ./tests/files/rgb_16_should_be_grayscale_8.png
Time (mean ± σ): 144.7 ms ± 6.3 ms [User: 497.5 ms, System: 25.5 ms]
Range (min … max): 134.7 ms … 159.4 ms 19 runs
@ -120,3 +122,4 @@ Benchmark #2: optipng -o 4 -simulate ./tests/files/rgb_16_should_be_grayscale_8.
Summary
'./target/release/oxipng -o4 -P ./tests/files/rgb_16_should_be_grayscale_8.png' ran
6.54 ± 0.29 times faster than 'optipng -o 4 -simulate ./tests/files/rgb_16_should_be_grayscale_8.png'
```

View file

@ -8,7 +8,10 @@ OXIPNG_VERSION=$(./target/release/oxipng -V)
OPTIPNG_VERSION=$(optipng -v | head -n 1)
RUST_VERSION=$(rustc -V)
echo "Tested $OXIPNG_VERSION (compiled on $RUST_VERSION) against $OPTIPNG_VERSION on $CPU with $CORES logical cores" >> README.md
echo -e '\n\n' >> README.md
echo -e '\n\n```\n' >> README.md
hyperfine --warmup 5 './target/release/oxipng -P ./tests/files/rgb_16_should_be_grayscale_8.png' 'optipng -simulate ./tests/files/rgb_16_should_be_grayscale_8.png' | ./node_modules/.bin/strip-ansi >> README.md
echo -e '\n\n' >> README.md
hyperfine --warmup 5 './target/release/oxipng -o4 -P ./tests/files/rgb_16_should_be_grayscale_8.png' 'optipng -o 4 -simulate ./tests/files/rgb_16_should_be_grayscale_8.png' | ./node_modules/.bin/strip-ansi >> README.md
echo -e '\n```\n' >> README.md