New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bcrypt.compare
very slow on production servers
#42
Comments
Looks like an issue with processing power to me. Also, if you have the opportunity to use native packages, you should favor |
Yep I've switched it |
By any chance... are you using 16.04 in your dyno? |
Nah, it runs on the cedar-14 stack, which is Ubuntu 14.04 |
Oh well. I happen to be running into the same problem on DigitalOcean via their 16.04 image. |
EventLoop blocking: console.time('A');
bcrypt.compare(record.password, admin.password, () => {});
bcrypt.compare(record.password, admin.password, () => {});
bcrypt.compare(record.password, admin.password, () => {});
console.timeEnd('A');
After switching to
WOW |
It looks like this 'issue' can be closed now... |
I am using the
bcryptjs
library in a Node project and am comparing a password that has been salted with 15 rounds. On any of my computers, this comparison is done in about 150ms. However, on Heroku servers, this comparison takes 8-9 seconds (for a 18 character password):After switching to
bcrypt
for comparison, it reduced to about 2.5 seconds:While about 3.5 times faster, this still seems rather long compared to running on a local machine. Is it memory or processing power that affects this duration?
The text was updated successfully, but these errors were encountered: