{"id":16731629,"url":"https://github.com/missinglink/through2-benchmark","last_synced_at":"2025-03-15T18:23:15.483Z","repository":{"id":140480482,"uuid":"97120958","full_name":"missinglink/through2-benchmark","owner":"missinglink","description":"simple benchmarking to check the performance of a through2 stream","archived":false,"fork":false,"pushed_at":"2017-07-13T12:38:41.000Z","size":2,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-22T08:11:20.976Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/missinglink.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-13T12:37:58.000Z","updated_at":"2017-07-13T14:04:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"6a35e618-bb2a-4f9c-8e1e-d1c4107067c2","html_url":"https://github.com/missinglink/through2-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/missinglink%2Fthrough2-benchmark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/missinglink%2Fthrough2-benchmark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/missinglink%2Fthrough2-benchmark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/missinglink%2Fthrough2-benchmark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/missinglink","download_url":"https://codeload.github.com/missinglink/through2-benchmark/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243771408,"owners_count":20345452,"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-12T23:38:13.569Z","updated_at":"2025-03-15T18:23:15.452Z","avatar_url":"https://github.com/missinglink.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Disclaimer\n\nThis module was written quick 'n dirty, it currently doesn't have tests and the API will probably change over time.\n\n## Installation\n\n```bash\n$ npm install through2-benchmark\n```\n\n[![NPM](https://nodei.co/npm/through2-benchmark.png?downloads=true\u0026stars=true)](https://nodei.co/npm/through2-benchmark)\n\n## Example\n\n```javascript\n// copied from example.js\n\nvar through = require('through2'),\n    benchmark = require('through2-benchmark');\n\nfunction createDelayStream( delay ){\n  return through.obj( function( chunk, enc, next ){\n    setTimeout( function(){\n      this.push( chunk );\n      this.push( chunk );\n      next();\n    }.bind(this), delay );\n  });\n}\n\nvar streams = {\n  stream1: createDelayStream(200),\n  stream2: createDelayStream(100),\n  tap: through.obj(),\n  sink: through.obj( function( _, __, next ){ next(); })\n};\n\nstreams.tap\n  .pipe( benchmark.proxy( 'stream1', streams.stream1 ) )\n  .pipe( benchmark.proxy( 'stream2', streams.stream2 ) )\n  .pipe( benchmark.proxy( 'sink', streams.sink ) );\n\nfor( var i=0; i\u003c10; i++ ){\n  streams.tap.write({ hello: 'world' });\n}\n\nstreams.tap.end();\n```\n\n```bash\n$ node example.js\n[stream1] processed 10 records in 2015.7093 ms\n[stream1] average speed 201.5709 ms\n[stream2] processed 20 records in 2025.5596 ms\n[stream2] average speed 101.278 ms\n[sink] processed 40 records in 0.8005 ms\n[sink] average speed 0.02 ms\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmissinglink%2Fthrough2-benchmark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmissinglink%2Fthrough2-benchmark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmissinglink%2Fthrough2-benchmark/lists"}