Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
String() vs .toString() vs Concatenation vs Template string
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36
Browser:
Chrome 126
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
String()
65320.2 Ops/sec
.toString()
787764.0 Ops/sec
Concatenation
2277666.8 Ops/sec
Template string
2416239.8 Ops/sec
Tests:
String()
let num = 500; let nums = []; for(let i = 0; i < 100; ++i) { nums.push(String(num)); }
.toString()
let num = 500; let nums = []; for(let i = 0; i < 100; ++i) { nums.push(num.toString()); }
Concatenation
let num = 500; let nums = []; for(let i = 0; i < 100; ++i) { nums.push(''+num); }
Template string
let num = 500; let nums = []; for(let i = 0; i < 100; ++i) { nums.push(`${num}`); }