[TASK] Add performance test "npm run perf"

This commit is contained in:
Chris Clark
2015-01-23 17:03:57 -08:00
parent 1637d26de3
commit 9fd64a9209
3 changed files with 16 additions and 1 deletions

3
.gitignore vendored
View File

@@ -56,3 +56,6 @@ dist/
# Ignore flow output directory
out/
# Ignore perf test cache
scripts/cache

View File

@@ -50,7 +50,8 @@
"pretest": "node_modules/.bin/gulp concat-sjcl",
"test": "./node_modules/.bin/istanbul test -x build/sjcl.js -x src/js/jsbn/* ./node_modules/mocha/bin/_mocha -- --reporter tap test/*-test.js",
"coveralls": "cat ./coverage/lcov.info | ./node_modules/.bin/coveralls",
"lint": "./node_modules/.bin/gulp lint"
"lint": "./node_modules/.bin/gulp lint",
"perf": "./scripts/perf_test.sh"
},
"repository": {
"type": "git",

11
scripts/perf_test.sh Executable file
View File

@@ -0,0 +1,11 @@
#!/bin/sh
URL="https://www.dropbox.com/s/a0gy7vbb86eeqlq/ledger-full-1000000.json?dl=1"
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
DEST="$DIR/cache/ledger-full-1000000.json"
if [ ! -e "$DEST" ]
then
echo "Downloading test data..."
mkdir -p "$DIR/cache"
curl -L "$URL" > "$DEST"
fi
time node "$DIR/verify_ledger_json.js" "$DEST"