Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Template string vs array join
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/134.0.0.0 Safari/537.36
Browser:
Chrome 134
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Template string slicing
49319032.0 Ops/sec
Array push and join
3402783.5 Ops/sec
Tests:
Template string slicing
const id = '10135533-2332-4012-aada-b36571a05399'; `${id.slice(1, 8)}${id.slice(9, 13)}${id.slice(15, 18)}`
Array push and join
const id = '10135533-2332-4012-aada-b36571a05399'; const timeStampParts = [] const chars = id.split('') let index = 0 for (const char of chars) { if ( (index !== 0 && index < 8) || (index >= 9 && index < 13) || (index >= 15 && index < 18) ) { timeStampParts.push(char) } index += 1 } const timestamp = timeStampParts.join('')