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

Commit ced86ba

Browse files
feat: add simple benchmark script
1 parent c346c54 commit ced86ba

File tree

5 files changed

+32
-1
lines changed

5 files changed

+32
-1
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,5 @@ node_modules
3333

3434
lib
3535
dist
36+
37+
current.json

.npmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,5 @@ build
3232
node_modules
3333

3434
test
35+
36+
current.json

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
"release": "PHANTOM=off gulp release",
2121
"release-minor": "PHANTOM=off gulp release --type minor",
2222
"release-major": "PHANTOM=off gulp release --type major",
23-
"coverage-publish": "aegir-coverage publish"
23+
"coverage-publish": "aegir-coverage publish",
24+
"bench": "./scripts/bench.sh"
2425
},
2526
"pre-commit": [
2627
"lint",

scripts/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Scripts
2+
3+
## `bench.sh`
4+
5+
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.
6+
7+
### Requirements
8+
9+
- go
10+
- Node.js

scripts/bench.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/sh
2+
3+
echo "-- downloading benchmarks"
4+
go get github.com/whyrusleeping/ipfs-whatever
5+
6+
echo "-- setting up ipfs"
7+
export IPFS_PATH=/tmp/bench-repo
8+
node src/cli/bin.js init
9+
node src/cli/bin.js daemon &
10+
sleep 5
11+
12+
echo "-- running benchmarks"
13+
ipfs-whatever > current.json
14+
15+
echo "-- cleaning up"
16+
rm -rf /tmp/bench-repo

0 commit comments

Comments
 (0)