Template literals in logs

Benchmark created on


Description

Check if template literals usage in console.log instead of string template arguments affects the performance

Setup

const a = [...new Array(100000)].map((_, i) => i);

Test runner

Ready to run.

Testing in
TestOps/sec
Template literal
a.map(i => console.log(`Item ${i}`))
ready
String template arguments
a.map(i => console.log("Item %d", i))
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.