-
-
Notifications
You must be signed in to change notification settings - Fork 35.1k
Closed
Labels
linuxIssues and PRs related to the Linux platform.Issues and PRs related to the Linux platform.performanceIssues and PRs related to the performance of Node.js.Issues and PRs related to the performance of Node.js.v8 engineIssues and PRs related to the V8 dependency.Issues and PRs related to the V8 dependency.
Description
Version
v17.3.0
Platform
Linux DESKTOP 5.10.60.1-microsoft-standard-WSL2 #1 SMP Wed Aug 25 23:20:18 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
vm
Though most likely deps/V8
What steps will reproduce the bug?
const { compileFunction } = require(`vm`);
const value = `a`.repeat(1024 * 1024 * 5);
console.time(`string`);
for (let i = 0; i < 1000; i++) {
compileFunction(`"${value}"`, [], {});
}
console.timeEnd(`string`);
console.time(`template`);
for (let i = 0; i < 1000; i++) {
compileFunction(`\`${value}\``, [], {});
}
console.timeEnd(`template`);How often does it reproduce? Is there a required condition?
Always
What is the expected behavior?
The amount of time it takes to compile should ideally be the same.
What do you see instead?
Compiling the template literal is significantly slower
string: 19.088s
template: 26.216s
Additional information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
linuxIssues and PRs related to the Linux platform.Issues and PRs related to the Linux platform.performanceIssues and PRs related to the performance of Node.js.Issues and PRs related to the performance of Node.js.v8 engineIssues and PRs related to the V8 dependency.Issues and PRs related to the V8 dependency.