Unverified Commit e32425bf authored by Brian White's avatar Brian White
Browse files

module: avoid JSON.stringify() for cache key

By avoiding JSON.stringify() and simply joining the strings with a
delimiter that does not appear in paths, we can improve cached
require() performance by at least 50%.

Additionally, this commit removes the last source of permanent
function deoptimization (const) for _findPath().

PR-URL: https://github.com/nodejs/node/pull/10789


Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
Reviewed-By: default avatarMichaël Zasso <targos@protonmail.com>
Reviewed-By: default avatarMichael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: default avatarMatteo Collina <matteo.collina@gmail.com>
Reviewed-By: default avatarBenjamin Gruenbaum <benjamingr@gmail.com>
parent 28dc848e
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment