Update compare script

This commit is contained in:
Andrew 2023-09-29 09:16:04 +13:00
parent a8b0ca19b3
commit db7f238507
3 changed files with 9 additions and 1370 deletions

1337
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,26 +0,0 @@
{
"name": "oxipng",
"version": "1.0.0",
"description": "[![Build Status](https://travis-ci.org/shssoichiro/oxipng.svg?branch=master)](https://travis-ci.org/shssoichiro/oxipng) [![Version](https://img.shields.io/crates/v/oxipng.svg)](https://crates.io/crates/oxipng) [![License](https://img.shields.io/crates/l/oxipng.svg)](https://github.com/shssoichiro/oxipng/blob/master/LICENSE)",
"main": "index.js",
"private": true,
"directories": {
"test": "tests"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/shssoichiro/oxipng.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/shssoichiro/oxipng/issues"
},
"homepage": "https://github.com/shssoichiro/oxipng#readme",
"devDependencies": {
"strip-ansi-cli": "^3.0.0"
}
}

View file

@ -1,17 +1,19 @@
#!/bin/bash #!/bin/bash
cargo build --release cargo build --release
cp README.template.md README.md sed -i.bak '/## Benchmarks/,$d' README.md
rm README.md.bak
CORES=$(sysctl -n hw.ncpu 2>/dev/null || grep -c ^processor /proc/cpuinfo) CORES=$(sysctl -n hw.ncpu 2>/dev/null || grep -c ^processor /proc/cpuinfo)
CPU=$(sysctl -n machdep.cpu.brand_string 2>/dev/null || grep '^model name' /proc/cpuinfo | sed 's/model name.\+: //g' | head -n 1) CPU=$(sysctl -n machdep.cpu.brand_string 2>/dev/null || grep '^model name' /proc/cpuinfo | sed 's/model name.\+: //g' | head -n 1)
OXIPNG_VERSION=$(./target/release/oxipng -V) OXIPNG_VERSION=$(./target/release/oxipng -V)
OPTIPNG_VERSION=$(optipng -v | head -n 1) OPTIPNG_VERSION=$(optipng -v | head -n 1)
RUST_VERSION=$(rustc -V) RUST_VERSION=$(rustc -V)
echo -e '## Benchmarks\n' >> README.md
echo "Tested $OXIPNG_VERSION (compiled on $RUST_VERSION) against $OPTIPNG_VERSION on $CPU with $CORES logical cores" >> README.md echo "Tested $OXIPNG_VERSION (compiled on $RUST_VERSION) against $OPTIPNG_VERSION on $CPU with $CORES logical cores" >> 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 echo -e '\n```\n' >> README.md
hyperfine --style basic --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' >> README.md
echo -e '\n\n' >> README.md
hyperfine --style basic --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' >> README.md
echo -e '\n```' >> README.md