{"id":17445968,"url":"https://github.com/jamen/tape-benchmark","last_synced_at":"2025-04-02T10:43:12.643Z","repository":{"id":65374629,"uuid":"80195276","full_name":"jamen/tape-benchmark","owner":"jamen","description":"Benchmarking functions for tape","archived":false,"fork":false,"pushed_at":"2017-01-27T09:32:55.000Z","size":5,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-09T15:19:07.993Z","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/jamen.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-27T09:32:45.000Z","updated_at":"2021-12-19T15:41:28.000Z","dependencies_parsed_at":"2023-01-20T01:25:16.631Z","dependency_job_id":null,"html_url":"https://github.com/jamen/tape-benchmark","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamen%2Ftape-benchmark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamen%2Ftape-benchmark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamen%2Ftape-benchmark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamen%2Ftape-benchmark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jamen","download_url":"https://codeload.github.com/jamen/tape-benchmark/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246802594,"owners_count":20836365,"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-10-17T18:19:13.954Z","updated_at":"2025-04-02T10:43:12.609Z","avatar_url":"https://github.com/jamen.png","language":"JavaScript","funding_links":["https://www.paypal.me/jamenmarz/5usd"],"categories":[],"sub_categories":[],"readme":"\n# tape-benchmark\n\n\u003e Benchmarking functions for tape\n\n```js\n// Load tape into tape-benchmark:\nvar test = require('tape-benchmark')(require('tape'))\n\ntest('my-test', function (t) {\n  // plan and do your asserts here ...\n  // then create benchmark asserts:\n\n  t.benchmark('original', function () {\n    // ...\n  })\n\n  t.benchmark('variant', { minSamples: 100 }, function () {\n    // ...\n  })\n})\n```\n\nThis module wraps [`benchmark`](https://npmjs.com/package/benchmark) into [`tape`](https://npmjs.com/tape) asserts.  So there is no setup between the two, and you get the same logging with both.\n\n## Installation\n\n```sh\n$ npm install --save tape-benchmark\n```\n\n## Usage\n\n### `load(tape)`\n\nLoad benchmark assertions onto tape\n\n```js\n// Load like this:\nvar test = require('tape-benchmark')(require('tape'))\n\n// Or just like this:\nrequire('tape-benchmark')(test)\n```\n\n### `t.benchmark(name, [options], fn)`\n\nRun benchmark as an assertion.  Passes with results, or fails with an error. Use `t.bench` as a shorthand.\n\n```js\ntest('my-test', function (t) {\n  t.plan(2)\n\n  t.benchmark('original', function () {\n    (123).toString()\n  })\n\n  t.benchmark('binary', { minSamples: 100 }, function () {\n    (123).toString(2)\n  })\n})\n```\n\n## License\n\nMIT © [Jamen Marz](https://git.io/jamen)\n\n---\n\n[![version](https://img.shields.io/npm/v/tape-benchmark.svg?style=flat-square)][package] [![travis](https://img.shields.io/travis/tape-benchmark/jamen.svg?style=flat-square)](https://travis-ci.org/tape-benchmark/jamen) [![downloads/month](https://img.shields.io/npm/dm/tape-benchmark.svg?style=flat-square)][package] [![downloads](https://img.shields.io/npm/dt/tape-benchmark.svg?style=flat-square)][package] [![license](https://img.shields.io/npm/l/tape-benchmark.svg?style=flat-square)][package] [![support me](https://img.shields.io/badge/support%20me-paypal-green.svg?style=flat-square)](https://www.paypal.me/jamenmarz/5usd) [![follow](https://img.shields.io/github/followers/jamen.svg?style=social\u0026label=Follow)](https://github.com/jamen)\n[package]: https://npmjs.com/package/tape-benchmark\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamen%2Ftape-benchmark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamen%2Ftape-benchmark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamen%2Ftape-benchmark/lists"}