{"id":14956057,"url":"https://github.com/ipfs/benchmarks","last_synced_at":"2025-10-01T16:31:52.277Z","repository":{"id":33358782,"uuid":"157403793","full_name":"ipfs/benchmarks","owner":"ipfs","description":"Benchmarking for IPFS","archived":false,"fork":false,"pushed_at":"2024-07-30T18:50:11.000Z","size":4316,"stargazers_count":20,"open_issues_count":34,"forks_count":8,"subscribers_count":27,"default_branch":"master","last_synced_at":"2025-01-14T11:59:51.533Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ipfs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-13T15:38:42.000Z","updated_at":"2024-10-03T12:41:05.000Z","dependencies_parsed_at":"2024-09-24T13:25:03.578Z","dependency_job_id":null,"html_url":"https://github.com/ipfs/benchmarks","commit_stats":{"total_commits":696,"total_committers":14,"mean_commits":"49.714285714285715","dds":0.5330459770114943,"last_synced_commit":"b060dfc9e59be32ad3306c91625da82401bbd2d0"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipfs%2Fbenchmarks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipfs%2Fbenchmarks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipfs%2Fbenchmarks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipfs%2Fbenchmarks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ipfs","download_url":"https://codeload.github.com/ipfs/benchmarks/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234883315,"owners_count":18901365,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-24T13:12:14.892Z","updated_at":"2025-10-01T16:31:51.823Z","avatar_url":"https://github.com/ipfs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":" # js-ipfs Benchmarks [![CircleCI](https://circleci.com/gh/ipfs/benchmarks.svg?style=svg)](https://circleci.com/gh/ipfs/benchmarks)\n\nThis is a set of benchmarks tests to track [js-ipfs](https://github.com/ipfs/js-ipfs) Benchmarks in a Grafana [Dashboard](https://benchmarks.ipfs.team).\n\n## Purpose\n\nThe IPFS team needs a historical view of various performance metrics around `js-ipfs`\nand how it compares to the reference implementation written in `go`. This project\nimplements benchmark tests for `js-ipfs` and publishes the results in a dashboard.\nThe artifacts are also made available on the IPFS network. Over time the historical\nview will expose how `js-ipfs` is hopefully approaching the `go` implementation\nand which areas need improvement.\n\n![Architecture](architecture.png)\n\nThe goal is to provide immediate feedback and long-term tracking around performance\nto developers and the community with an extremely low barrier.\nThe CI system integrating code changes will trigger benchmark runs as well a scheduled\nrun every night. Each run will provide a URL where the results will be visible.\n\nThis project also provides a possibility to run tests locally on a development\nversion of `js-ipfs`. Developers can then examine individual output files before\nsubmitting code to the community.\n\n## Documentation Index\n\n* The [dashboard](infrastructure/grafana/README.md) documentation\n* [Architecture](infrastructure/README.md) of the `js-ipfs` benchmark system\n* Reference on how this [Repository](CONTRIBUTING.md) is organized\n* Using the [Runner](runner/README.md) to manage benchmark runs remotely, which includes an [API](https://benchmarks.ipfs.team/runner/docs/index.html) available [here](https://benchmarks.ipfs.team/runner)\n* Description of [tests](tests/README.md)\n* Convenience [scripts](scripts/README.md) for the docker-compose [deployment](infrastructure/deploy/README.md)\n* Overview [video](https://ipfs.io/ipfs/QmSZgcL7dyjcifZ5uJYmBDCCACfzQD5Ve2RFSoB4RdYATp) hosted on the IPFS network.\n* [Introduction to Clinic.js in the context of IPFS](https://github.com/ipfs/team-mgmt/issues/796) [Recording](https://nearform.zoom.us/recording/play/A-4Vn3jA5aeK9BCPwKCA44IfwpLZePIBlzvD1bUYF7JqTXnG2JptVaLEVcRUmQ1i)\n\n## Benchmarks on the web\n\nThe dashboard is available at [https://benchmarks.ipfs.team](https://benchmarks.ipfs.team) and can be viewed without a user account.\nA `Continuous Integration` server can trigger benchmark runs using the endpoint exposed on [https://benchmarks.ipfs.team/runner](https://benchmarks.ipfs.team/runner). A commit from the [js-ipfs](https://github.com/ipfs/js-ipfs) repository can be supplied to run the benchmarks against. An api key is also required to be able to trigger a run. Please check [Runner](runner/README.md) docs on how to configure an api key for the runner. An example invocation using curl is provided below.\n\n```bash\n\u003e curl -XPOST -d '{\"commit\":\"adfy3hk\"}' \\\n  -H \"Content-Type: application/json\" \\\n  -H \"x-ipfs-benchmarks-api-key: \u003capi-key\u003e\" \\\n  https://benchmarks.ipfs.team/runner\n```\n\nThe response provides links to the output produced by the benchmark tests:\n\n```\nTBD\n```\n\nFor more details about the dashboard see the [Grafana](infrastructure/grafana/README.md) doc.\n\n## Quickstart\n\nClone Benchmark tests and install:\n\n```bash\n\u003e  git clone https://github.com/ipfs/benchmarks.git\n\u003e  cd benchmarks/runner\n\u003e  npm install\n\u003e  cd ../tests\n\u003e  npm install\n```\n\n### Generate test files\n\nThe files are defined in [fixtures](tests/lib/fixtures.js).\n\n```bash\n\u003e npm run generateFiles\n```\n\n### Add test files\n\nHere is the file object for a single test:\n\n```js\n{ size: KB, name: 'OneKBFile' }\n```\n\nTo add multiple test files add a count property:\n\n```js\n{ size: KB, name: 'OneHundredKBFile', count: 100 }\n```\n\n### Run tests locally\n\nFrom the `benchmarks/tests` directory:\n\n```bash\n\u003e node local-add\n\u003e node local-extract\n\u003e node local-transfer\n```\n\nRun all benchmarks:\n\n```bash\n\u003e npm run benchmark\n```\n\nCreate a pre-generated key:\n\n```bash\n\u003e node util/create-privateKey\n```\n\n#### FILESET\n\nUse env variable `FILESET` to run test just against that specific set of file(s).  Options of `FILESET` are defined in the config.\n\n```bash\n\u003e FILESET=\"One64MBFile\" node local-add\n```\n\n#### VERIFYOFF\n\nUse env variable `VERIFYOFF=true` to skip the pre-generation of test files.\n\n```js\n\u003e VERIFYOFF=true node local-add\n```\n\n#### Run tests locally on a js-ipfs branch\n\nInside the `benchmarks/tests` dir is a script to pull down master branch and install:\n\n```bash\n\u003e ./getIpfs.sh ../\n```\n\nDirectory structure now :\n```\n├── benchmarks\n├──── js-ipfs\n├──── tests\n```\n\nRun tests against branch\n\n```bash\n\u003e cd benchmarks/tests\n\u003e STAGE=local REMOTE=true node local-add\n```\n\n#### FLAGS\n\nBelow is a list of optional flags used by the tests to run a specific strategy or transport module in Libp2p.\n\n- `-s` DAG strategy (balanced | trickle)\n- `-t` Transport (tcp | ws)\n- `-m` Stream muxer (mplex, spdy)\n- `-e` Connection encryption (secio)\n\n### Adding new tests\n\nSee [README](tests/README.md).\n\n###  Results\n\nResults will be written to out directory under `benchmarks/tests`\n\n* `name`: Name of test\n* `warmup`: Flag for if we warm up db\n* `description`: Description of benchmark\n* `fileSet`: Set of files to be used in a test\n* `date`: Date of benchmark\n* `file`: Name of file used in benchmark\n* `meta.project`: Repo that are benchmarked\n* `meta.commit`: Commit used to trigger benchmark\n* `meta.version`: Version of js-ipfs\n* `duration.s`: The number of seconds for benchmark\n* `duration.ms`: The number of millisecs the benchmark took\n* `cpu`: Information about cpu benchmark was run on\n* `loadAvg`: The load average of machine\n\n## License\n\nCopyright (c) Protocol Labs, Inc. under the MIT license. See [LICENSE file](./LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fipfs%2Fbenchmarks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fipfs%2Fbenchmarks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fipfs%2Fbenchmarks/lists"}