Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
String split + join or charAt + concat
Performance differences of using inbuilt string and array methods for splitting and joining char array. Or using loops to extract chars and string concatenation for joining.
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:138.0) Gecko/20100101 Firefox/138.0
Browser:
Firefox 138
Operating system:
Ubuntu
Device Platform:
Desktop
Date tested:
11 months ago
Test name
Executions per second
split + join
1105254.8 Ops/sec
charAt + join
120701800.0 Ops/sec
split + concat
1428615.8 Ops/sec
charAt + concat
325355296.0 Ops/sec
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
const string = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque eget venenatis eros.";
Tests:
split + join
const splitted = string.split(''); const joined = splitted.join('');
charAt + join
const splitted = []; for (let i = 0; i < splitted.length; i++){ splitted.push(splitted[i]); } const joined = splitted.join('');
split + concat
const splitted = string.split(''); let text = ''; for (let i = 0; i < splitted.length; i++){ text += splitted[i] }
charAt + concat
const splitted = []; for (let i = 0; i < splitted.length; i++){ splitted.push(splitted[i]); } let text = ''; for (let i = 0; i < splitted.length; i++){ text += splitted[i] }