{"id":17190686,"url":"https://github.com/nicknaso/bcrypt-perf","last_synced_at":"2025-03-25T05:54:25.266Z","repository":{"id":74155241,"uuid":"115052143","full_name":"NickNaso/bcrypt-perf","owner":"NickNaso","description":"Performance of bcrypt ","archived":false,"fork":false,"pushed_at":"2018-01-09T22:23:07.000Z","size":1971,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-01T10:37:13.883Z","etag":null,"topics":["addons","nan","napi","nodejs","nodejs-addon","nodejs-modules","performance"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NickNaso.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-12-21T22:20:28.000Z","updated_at":"2018-01-03T11:44:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"8192484d-05eb-4482-9cd1-d8dd267bd06a","html_url":"https://github.com/NickNaso/bcrypt-perf","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/NickNaso%2Fbcrypt-perf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NickNaso%2Fbcrypt-perf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NickNaso%2Fbcrypt-perf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NickNaso%2Fbcrypt-perf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NickNaso","download_url":"https://codeload.github.com/NickNaso/bcrypt-perf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245407771,"owners_count":20610234,"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":["addons","nan","napi","nodejs","nodejs-addon","nodejs-modules","performance"],"created_at":"2024-10-15T01:23:36.246Z","updated_at":"2025-03-25T05:54:25.245Z","avatar_url":"https://github.com/NickNaso.png","language":"JavaScript","readme":"# Bcrypt for Node.js\n\n## Performance estimation between NAN and N-API implementation\n\nRecently I worked on the porting of bcrypt for Node.js to the new **N-API** and \nnow I created this repository to do some experiments to estimate the performance\nagainst the previous version impelented with **NAN**.\n\n## Environment\n\n- Node.js Version **8.9.3**\n\n- OS **macOS** - High Sierra (10.13.2)\n\n- **MacBook Pro** (13-inch, 2016, Four Thunderbolt 3 Ports)\n\n- CPU **2,9 GHz** Intel Core i5\n\n- Memory **16 GB** 2133 MHz LPDDR3\n\n## Experiments\n\nI created two main experiments one where I used bcrypt to hash a password with \n```salt round``` parameter set to **10** and **11**, and another where I used \nbcrypt to compare password. Obviously I executed this for both synchronous and \nasynchronous api that bcrypt expose. Eacher task was repeated **1000** times and than\nI considered as result to compare the NAN and N-API version the avarage of the \ntime execution.  \n\n## Results\n\n#### Hash password **using synchronous** api and **salt round** set to **10** \n\nIn average the N-API version of the addon is **1.74**% faster than NAN version\n\n#### Hash password **using synchronous** api and **salt round** set to **11** \n\nIn average the N-API version of the addon is **1.82**% faster than NAN version\n\n#### Hash password **using asynchronous** api and **salt round** set to **10** \n\nIn average the N-API version of the addon is **1.29**% faster than NAN version\n\n#### Hash password **using asynchronous** api and **salt round** set to **11** \n\nIn average the N-API version of the addon is **0.74**% faster than NAN version\n\n#### Compare password **using synchronous** api and **salt round** set to **10** \n\nIn average the N-API version of the addon is **4.19**% faster than NAN version\n\n#### Compare password **using synchronous** api and **salt round** set to **11** \n\nIn average the N-API version of the addon is **2.97**% faster than NAN version\n\n#### Compare password **using asynchronous** api and **salt round** set to **10** \n\nIn average the N-API version of the addon is **1.73**% faster than NAN version\n\n#### Compare password **using asynchronous** api and **salt round** set to **11** \n\nIn average the N-API version of the addon is **1.33**% faster than NAN version\n\n## Resources\n\nYou can find all raw data deriving from my work on the folder **[results](/results)** \n\n## Web application\n\nAdded little and simple web application and test performance with **autocannon**\nthe reuslts are very similiar between the bcrypt implemented with N-API and NAN.\n\n## The Team\n\n### Nicola Del Gobbo\n\n\u003chttps://github.com/NickNaso/\u003e\n\n\u003chttps://www.npmjs.com/~nicknaso\u003e\n\n\u003chttps://twitter.com/NickNaso\u003e\n\n## Acknowledgements\n\nThank you to all people that encourage me every day.\n\n## License\n\nLicensed under [Apache license V2](./LICENSE)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicknaso%2Fbcrypt-perf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnicknaso%2Fbcrypt-perf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicknaso%2Fbcrypt-perf/lists"}