{"action":"created","issue":{"url":"https://api.github.com/repos/dcodeIO/bcrypt.js/issues/39","repository_url":"https://api.github.com/repos/dcodeIO/bcrypt.js","labels_url":"https://api.github.com/repos/dcodeIO/bcrypt.js/issues/39/labels{/name}","comments_url":"https://api.github.com/repos/dcodeIO/bcrypt.js/issues/39/comments","events_url":"https://api.github.com/repos/dcodeIO/bcrypt.js/issues/39/events","html_url":"https://github.com/dcodeIO/bcrypt.js/issues/39","id":168358743,"number":39,"title":"Threads - sync vs async","user":{"login":"tamlyn","id":115310,"avatar_url":"https://avatars.githubusercontent.com/u/115310?v=3","gravatar_id":"","url":"https://api.github.com/users/tamlyn","html_url":"https://github.com/tamlyn","followers_url":"https://api.github.com/users/tamlyn/followers","following_url":"https://api.github.com/users/tamlyn/following{/other_user}","gists_url":"https://api.github.com/users/tamlyn/gists{/gist_id}","starred_url":"https://api.github.com/users/tamlyn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tamlyn/subscriptions","organizations_url":"https://api.github.com/users/tamlyn/orgs","repos_url":"https://api.github.com/users/tamlyn/repos","events_url":"https://api.github.com/users/tamlyn/events{/privacy}","received_events_url":"https://api.github.com/users/tamlyn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-07-29T16:05:23Z","updated_at":"2016-09-30T10:12:41Z","closed_at":null,"body":"I'm trying to understand the benefit of using the async methods in this lib. \r\n\r\nIn [`node.bcrypt.js`](https://github.com/ncb000gt/node.bcrypt.js), the async methods [use threads under the hood](https://github.com/ncb000gt/node.bcrypt.js/issues/303) to keep the expensive computations out of the main Node process. \r\n\r\nBy contrast this lib uses `nextTick`/`setImmediate` which just delays the expensive computation until the current call stack has completed. Doesn't this mean that several users logging in in quick succession could lock up the application? \r\n\r\nIf so is there a recommended way to mitigate this issue (e.g. using `child_process` or similar)?"},"comment":{"url":"https://api.github.com/repos/dcodeIO/bcrypt.js/issues/comments/250709407","html_url":"https://github.com/dcodeIO/bcrypt.js/issues/39#issuecomment-250709407","issue_url":"https://api.github.com/repos/dcodeIO/bcrypt.js/issues/39","id":250709407,"user":{"login":"axelpale","id":992081,"avatar_url":"https://avatars.githubusercontent.com/u/992081?v=3","gravatar_id":"","url":"https://api.github.com/users/axelpale","html_url":"https://github.com/axelpale","followers_url":"https://api.github.com/users/axelpale/followers","following_url":"https://api.github.com/users/axelpale/following{/other_user}","gists_url":"https://api.github.com/users/axelpale/gists{/gist_id}","starred_url":"https://api.github.com/users/axelpale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/axelpale/subscriptions","organizations_url":"https://api.github.com/users/axelpale/orgs","repos_url":"https://api.github.com/users/axelpale/repos","events_url":"https://api.github.com/users/axelpale/events{/privacy}","received_events_url":"https://api.github.com/users/axelpale/received_events","type":"User","site_admin":false},"created_at":"2016-09-30T10:12:41Z","updated_at":"2016-09-30T10:12:41Z","body":"Seems legit. Chopping the operation into smaller pieces is the best what we can do with a single JS event loop. Also, this is what a IO scheduler basically does on a single CPU, slicing and pausing execution to share time. Of course, an OS/hardware level scheduler does it in more efficient manner, but if the optimal efficiency is one's number one priority, then one should consider using [bcrypt](https://www.npmjs.com/package/bcrypt) over bcryptjs in the first place.\r\n\r\nI guess this issue can be closed. However, the valuable knowledge created here could be also in the README."}}
{"actor":{"display_login":"axelpale"}}