{"id":20806317,"url":"https://github.com/nodesource/nodejs-package-benchmark","last_synced_at":"2025-05-07T04:24:23.831Z","repository":{"id":239796212,"uuid":"764285500","full_name":"nodesource/nodejs-package-benchmark","owner":"nodesource","description":"Node.js benchmark for common web developer workloads. Inspired by https://github.com/v8/web-tooling-benchmark","archived":false,"fork":false,"pushed_at":"2024-10-17T17:39:45.000Z","size":77,"stargazers_count":29,"open_issues_count":5,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-28T00:46:58.660Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nodesource.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-02-27T20:04:21.000Z","updated_at":"2025-02-14T19:19:58.000Z","dependencies_parsed_at":"2024-10-19T21:42:48.932Z","dependency_job_id":null,"html_url":"https://github.com/nodesource/nodejs-package-benchmark","commit_stats":null,"previous_names":["nodesource/nodejs-package-benchmark"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodesource%2Fnodejs-package-benchmark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodesource%2Fnodejs-package-benchmark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodesource%2Fnodejs-package-benchmark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodesource%2Fnodejs-package-benchmark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nodesource","download_url":"https://codeload.github.com/nodesource/nodejs-package-benchmark/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252811462,"owners_count":21807939,"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-11-17T19:19:16.740Z","updated_at":"2025-05-07T04:24:23.772Z","avatar_url":"https://github.com/nodesource.png","language":"JavaScript","readme":"# nodejs-package-benchmark\n\nThis package allows you to benchmark different runtimes using popular\npackages operations.\n\n## Supported packages\n\n- [x] ~fastify~ - Temporary disabled.\n- [x] lodash\n- [x] prettier\n- [x] babel\n- [x] moment\n- [x] dotenv\n- [x] pinojs\n- [x] winston\n- [x] underscore\n- [x] typescript\n\n## Install\n\n```console\nnpm i -g nodejs-package-benchmark\n```\n\n## Comparison\n\nTo compare binaries, you can use the `bench-it` script.\n\n### Syntax: `bench-it $BINARY [\"baseline\"]`\n\nThis script allows you to compare the performance of binaries. If it's your first run, you need to generate the `baseline` data using:\n\n```console\n$ bench-it ./node baseline\n```\n\nTo compare subsequent runs, simply omit the \"baseline\" option:\n\n```console\n$ bench-it ./node\n```\n\u003e [!TIP]\n\u003e It's recommended to have `colordiff` installed for a clearer comparison of differences.\n\n## Single run\n\nTo a pretty terminal output, run `index.js`\n\n```console\n$ node --allow-natives-syntax index.js\ncpu: 13th Gen Intel(R) Core(TM) i5-13600K (20 cores)\nnode: v20.13.1 (/home/hzk/.nvm/versions/node/v20.13.1/bin/node)\nos: Linux 5.15.133.1-microsoft-standard-WSL2 x64\n---------------------------------------------------------------------\nbabel\n  transform (code=true ast=true):                                    147.1 (15 samples)\n  transform (code=false):                                            150.4 (16 samples)\ndotenv\n  config:                                                            64.39K (6440 samples)\nlodash\n  .chunk:                                                            19.62M (1961973 samples)\n  .groupBy:                                                          6.303M (630542 samples)\n  .includes:                                                         18.38M (1837801 samples)\n  .orderBy:                                                          1.737M (173672 samples)\nmoment\n  format (full):                                                     878.8K (87908 samples)\n  format:                                                            839.3K (83928 samples)\n  fromNow (YYYYMMDD):                                                153.4K (15339 samples)\n  subtract (10):                                                     288.7K (28871 samples)\npinojs\n  info (10x):                                                        243.7K (24686 samples)\nprettier\n  format:                                                            71.71 (10 samples)\n  format (singleQuote=true useTabs=true):                            68.52 (10 samples)\n  format (semi=false):                                               70.61 (10 samples)\ntypescript\n  transpile:                                                         85.23 (10 samples)\n  createSourceFile:                                                  1.866K (187 samples)\n  getSemanticDiagnostics:                                            2.102 (10 samples)\nunderscore\n  .chunk:                                                            4.606M (467160 samples)\n  .groupBy:                                                          1.66M (169265 samples)\n  .includes:                                                         7.626M (762632 samples)\n  .orderBy:                                                          733.5K (73352 samples)\nwinston\n  info (10x):                                                        43.13K (4431 samples)\n---------------------------------------------------------------------\n```\n\nTo store it as JSON, just pipe output to a file:\n\n```console\n$ node index.js \u003e results.json\n$ cat result.json\n[\n  {\n    \"name\": \"babel\",\n    \"method\": \"benchmarkjs\",\n    \"operations\": [\n      {\n        \"name\": \"transform (code=true ast=true)\",\n        \"opsSec\": 67.80076532539411,\n        \"samples\": 3\n      },\n      {\n...\n```\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodesource%2Fnodejs-package-benchmark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnodesource%2Fnodejs-package-benchmark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodesource%2Fnodejs-package-benchmark/lists"}