Benchmarking tests for js-ipfs, using go-ipfs as a baseline.
Switch branches/tags
Nothing to show
Clone or download
richardschneider and diasdavid test: use os.tmpdir() (#12)
* test: use os.tmpdir()

* fix: use hat() for unique names
Latest commit d8542a8 Dec 5, 2017
Permalink
Failed to load latest commit information.
reports ipfs logo Mar 30, 2017
src test: use os.tmpdir() (#12) Dec 5, 2017
.gitignore ipfs logo Mar 30, 2017
LICENSE random byte generator working Apr 10, 2017
README.md readme goodness Apr 10, 2017
package.json test: use os.tmpdir() (#12) Dec 5, 2017

README.md

ipfs-performance-profiling

js-standard-style

Benchmarking tests for js-ipfs, using go-ipfs as a baseline.

Install

$ git clone https://github.com/ipfs/ipfs-performance-profiling.git
$ cd ipfs-performance-profiling
$ npm install

Run

Run all benchmarks on all environments:

$ npm run benchmarks

Run all benchmarks on the go and js-core environments:

$ npm run benchmarks -- --envs=go,js-core

Available environments are:

  • go
  • js-core
  • js-http

Run named benchmark on the js-http environment:

$ npm run benchmarks -- files-add-1MB-file --envs=js-http

JSON output

You can output a JSON report using the --json options:

$ npm run benchmarks -- files-add-1MB-file --json

Reports

You run and produce an HTML report using:

$ npm run benchmarks:report

Report with profiling data

You run and produce an HTML report containing links to profiling data using:

$ npm run benchmarks:report:profile -- [<suite>] --envs=[env1,env2]

Creating a benchmark suite

A benchmark suite is simply a function that gets two arguments: an IPFS client object and a callback:

module.exports = function (ipfs, callback) {
  ipfs.files.add([{
    path: 'a.txt',
    content: new Buffer('a')
  }], callback)
}

Add it under its own dir under src/suites. Also, don't forget to add an entry to src/suites/index.js so that it can be found.

Logging

The suite runner uses the stdout channel for the benchmark results. If you want to log to the console, use console.error instead.

Contribute

Feel free to join in. All welcome. Open an issue!

This repository falls under the IPFS Code of Conduct.

License

MIT