Test name | Executions per second |
---|---|
join | 85.5 Ops/sec |
for loop concatenation | 90.0 Ops/sec |
<!--your preparation HTML code goes here-->
/*your preparation JavaScript code goes here
To execute async code during the script preparation, wrap it as function globalMeasureThatScriptPrepareFunction, example:*/
const a = [];
async function globalMeasureThatScriptPrepareFunction() {
// This function is optional, feel free to remove it.
// await someThing();
for(let i = 0; i < 100000; i++) {
const x = Math.floor(Math.random() * 1000);
const y = Math.floor(Math.random() * 1000);
a.push({ x, y });
}
}
let g = 'M';
for(let point of a) {
const x = point.x.toFixed(0);
const y = point.y.toFixed(0);
g += x + ',' + y + ' ';
}
let b = 'M';
for(let j = 0; j < a.length; j++) {
const point = a[j];
const x = point.x.toFixed(0);
const y = point.y.toFixed(0);
b += x + ',' + y + ' ';
}