Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Template literals vs String concat vs Array.join()
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:137.0) Gecko/20100101 Firefox/137.0
Browser:
Firefox 137
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Template Literal
52.4 Ops/sec
String Concatenation
267.1 Ops/sec
Array.join()
3.5 Ops/sec
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
const slug = '1234567890';
Tests:
Template Literal
for (let i = 0; i < 1000000; i++) { const url = `/${slug}.html`; }
String Concatenation
for (let i = 0; i < 1000000; i++) { const url = '/' + slug + '.html'; }
Array.join()
for (let i = 0; i < 1000000; i++) { const url = ['/', slug, '.html'].join(''); }