Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Template Literal vs Tagged Template Literal
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:129.0) Gecko/20100101 Firefox/129.0
Browser:
Firefox 129
Operating system:
Ubuntu
Device Platform:
Desktop
Date tested:
one year ago
Template Literal
228.5M/s
Tagged Template Literal
15.5M/s
View exact numbers
Test name
Executions per second
✓
Template Literal
228,453,984 Ops/sec
Tagged Template Literal
15,465,986 Ops/sec
Script Preparation code:
var literal = (strings, ...values) => strings.reduce( (result, text, i) => (result += (text + ((i === strings.length - 1) ? "" : values[i]))), "" ); var innerText = "This is innerText";
Tests:
Template Literal
var text = `TEXT ${innerText} TEXT`;
Tagged Template Literal
var text = literal`TEXT ${innerText} TEXT`;