Skip to content

Instantly share code, notes, and snippets.

@rpf5573 rpf5573/test.js
Created Sep 26, 2018

Embed
What would you like to do?
thread count change
process.env.UV_THREADPOOL_SIZE = 2;
const crypto = require('crypto');
const start = Date.now();
crypto.pbkdf2( 'a', 'b', 100000, 512, 'sha512', () => {
console.log( '1:', Date.now() - start );
});
crypto.pbkdf2( 'a', 'b', 100000, 512, 'sha512', () => {
console.log( '2:', Date.now() - start );
});
crypto.pbkdf2( 'a', 'b', 100000, 512, 'sha512', () => {
console.log( '3:', Date.now() - start );
});
crypto.pbkdf2( 'a', 'b', 100000, 512, 'sha512', () => {
console.log( '4:', Date.now() - start );
});
crypto.pbkdf2( 'a', 'b', 100000, 512, 'sha512', () => {
console.log( '5:', Date.now() - start );
});
// output
// 2: 1108
// 1: 1117
// 3: 2321
// 4: 2364
// 5: 3447
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.