node-postgres
node-postgres copied to clipboard
cache password hash in SASL auth
In SASL auth handling, Hi function is called for every established connection although the password and hash are same. In my measurements, it takes 10-20ms to calculate the hash with default 4096 iterations. Caching the result of this function would significantly improve performance.
What do you think? I can prepare PR.
Just find out, Hi function can be replaced with crypto.pbkdf2Sync(password, salt, 4096, 32, 'sha256'), which is like 20 times faster..