Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
feat: add simple benchmark script
Browse files Browse the repository at this point in the history
  • Loading branch information
dignifiedquire committed Nov 28, 2016
1 parent 1a94699 commit 71781f5
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -33,3 +33,5 @@ node_modules

lib
dist

current.json
2 changes: 2 additions & 0 deletions .npmignore
Expand Up @@ -32,3 +32,5 @@ build
node_modules

test

current.json
5 changes: 3 additions & 2 deletions package.json
Expand Up @@ -30,7 +30,8 @@
"release": "gulp release",
"release-minor": "gulp release --type minor",
"release-major": "gulp release --type major",
"coverage-publish": "aegir-coverage publish"
"coverage-publish": "aegir-coverage publish",
"bench": "./scripts/bench.sh"
},
"pre-commit": [
"lint",
Expand Down Expand Up @@ -149,4 +150,4 @@
"nginnever <ginneversource@gmail.com>",
"npmcdn-to-unpkg-bot <npmcdn-to-unpkg-bot@users.noreply.github.com>"
]
}
}
10 changes: 10 additions & 0 deletions scripts/README.md
@@ -0,0 +1,10 @@
# Scripts

## `bench.sh`

Run benchmarks using [ipfs-whatever](https://github.com/whyrusleeping/ipfs-whatever). This will create a file called `current.json` in the current folder with the results.

### Requirements

- go
- Node.js
16 changes: 16 additions & 0 deletions scripts/bench.sh
@@ -0,0 +1,16 @@
#!/bin/sh

echo "-- downloading benchmarks"
go get github.com/whyrusleeping/ipfs-whatever

echo "-- setting up ipfs"
export IPFS_PATH=/tmp/bench-repo
node src/cli/bin.js init
node src/cli/bin.js daemon &
sleep 5

echo "-- running benchmarks"
ipfs-whatever > current.json

echo "-- cleaning up"
rm -rf /tmp/bench-repo

0 comments on commit 71781f5

Please sign in to comment.