{"id":17061512,"url":"https://github.com/yashladha/node-microbenchmark","last_synced_at":"2025-04-12T18:12:20.186Z","repository":{"id":44929250,"uuid":"259995582","full_name":"yashLadha/node-microbenchmark","owner":"yashLadha","description":"Micro benchmarking library for Node.JS 🚀","archived":false,"fork":false,"pushed_at":"2022-01-18T05:11:51.000Z","size":89,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-12T18:12:13.617Z","etag":null,"topics":["benchmarking","microbenchmark","node"],"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/yashLadha.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":"2020-04-29T17:31:26.000Z","updated_at":"2024-03-18T11:27:11.000Z","dependencies_parsed_at":"2022-08-27T23:12:21.001Z","dependency_job_id":null,"html_url":"https://github.com/yashLadha/node-microbenchmark","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yashLadha%2Fnode-microbenchmark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yashLadha%2Fnode-microbenchmark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yashLadha%2Fnode-microbenchmark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yashLadha%2Fnode-microbenchmark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yashLadha","download_url":"https://codeload.github.com/yashLadha/node-microbenchmark/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248610341,"owners_count":21132919,"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":["benchmarking","microbenchmark","node"],"created_at":"2024-10-14T10:47:20.767Z","updated_at":"2025-04-12T18:12:20.154Z","avatar_url":"https://github.com/yashLadha.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## node-microbenchmark\n\u003cimg src=\"https://img.icons8.com/color/48/000000/nodejs.png\"/\u003e\n\n[![npm version](https://badge.fury.io/js/node-microbenchmark.svg)](https://badge.fury.io/js/node-microbenchmark)\n\nA micro benchmarking library inspired from [google-benchmark](https://github.com/google/benchmark)\n\nFeatures available:\n* Benchmarking synchronous functions\n* Benchmarking of asynchronous functions\n    * Support for Promises\n* High precision benchmark (upto nanoseconds precision)\n\n### Benchmarking of synchronous functions\n```javascript\nconst { benchmark, show } = require('node-microbenchmark');\n\nconst slowFn = () =\u003e {\n    for (var i = 0; i \u003c 1e4; ++i);\n}\n\nconst fastFn = () =\u003e {}\n\nbenchmark(slowFn);\nbenchmark(fastFn);\n\nshow();\n```\n\n### Benchmarking of asynchronous functions\n```javascript\nconst benchmark = require('../index');\n\nconst slowTimer = () =\u003e new Promise(res =\u003e setTimeout(res, 200));\nconst fastTimer = () =\u003e new Promise(res =\u003e setTimeout(res, 50));\n\nconst fn = async () =\u003e {\n  await benchmark.benchmarkPromise(slowTimer);\n  await benchmark.benchmarkPromise(fastTimer);\n  benchmark.show();\n};\n\nfn();\n```\n\n\u003ckbd\u003e![node-microbenchmark](https://raw.githubusercontent.com/yashladha/node-microbenchmark/master/images/node-microbenchmark.png)\u003c/kbd\u003e\n\n## Future enhancements\n\n* Benchmark async code like promises.\n\n## Author\n\n* [yashLadha](https://github.com/yashLadha)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyashladha%2Fnode-microbenchmark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyashladha%2Fnode-microbenchmark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyashladha%2Fnode-microbenchmark/lists"}