Four pbkdf2 calls submitted at once finish at roughly the same time, but submitting eight makes the last four finish roughly twice as late. What internal mechanism explains this?
const c = require('crypto');
const start = Date.now();
let done = 0;
for (let i = 0; i < 8; i++) {
c.pbkdf2('a', 'b', 1e5, 64, 'sha512', () => {
if (++done === 4) console.log('4 done', Date.now() - start);
if (done === 8) console.log('8 done', Date.now() - start);
});
}