Skip to content

Node v11 6x crypto hash performance degradation #24266

Closed
@SergeyFromHell

Description

@SergeyFromHell
  • Version: v11.1.0
  • Platform: Linux
  • Subsystem: Crypto

I met a big performance degradation (about 6 times) with updating node version from 10.13.0 to 11.1.0. The scenario is: calculating many sha1 hashes of small strings (in my case theese are URLs, so about 20-50 bytes each).

const crypto = require('crypto');

const str = 'abcd'.repeat(10);

console.time('hash');
for(let i=0; i<1000000; ++i) {
	const hash = crypto.createHash('sha1').update(str).digest();
}
console.timeEnd('hash');

node 10 output:

hash: 3336.388ms

node 11 output:

hash: 18088.861ms

Metadata

Metadata

Assignees

No one assigned

    Labels

    cryptoIssues and PRs related to the crypto subsystem.performanceIssues and PRs related to the performance of Node.js.regressionIssues related to regressions.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions