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 (Windows NT 10.0; Win64; x64; rv:148.0) Gecko/20100101 Firefox/148.0
Browser:
Firefox 148
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one month ago
Test name
Executions per second
Template Literal
652.8 Ops/sec
String Concatenation
2279.5 Ops/sec
Array.join()
26.0 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(''); }