Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Test intArrya
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/135.0.0.0 Safari/537.36
Browser:
Chrome 135
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
obj
30377208.0 Ops/sec
uint8
8696616.0 Ops/sec
bas level
10824646.0 Ops/sec
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
/*your preparation JavaScript code goes here To execute async code during the script preparation, wrap it as function globalMeasureThatScriptPrepareFunction, example:*/ async function globalMeasureThatScriptPrepareFunction() { // This function is optional, feel free to remove it. // await someThing(); }
Tests:
obj
const splitArray = (arr) => { const displayed= []; const more= []; for (let i = 0; i < arr.length; i++) { if (i < 2) { displayed.push(arr[i]); } else { more.push(arr[i]); } } return { displayed, more }; }; const splitSelectedFilters = splitArray([1, 2, 3, 4, 5, 6]);
uint8
function splitUint8Array(arr) { const len = arr.length; // Si moins de 2 éléments, on gère les cas courts if (len <= 2) { return [arr.slice(0, len), new Uint8Array(0)]; } // Sinon, on divise normalement return [arr.slice(0, 2), arr.slice(2)]; } // Exemple d'utilisation : const input = new Uint8Array([1, 2, 3, 4, 5, 6]); const [displayed, more] = splitUint8Array(input);
bas level
function splitUint8ArrayManual(arr) { const len = arr.length; const firstLength = Math.min(2, len); const secondLength = len > 2 ? len - 2 : 0; const displayed = new Uint8Array(firstLength); const more = new Uint8Array(secondLength); for (let i = 0; i < firstLength; i++) { displayed[i] = arr[i]; } for (let i = 0; i < secondLength; i++) { more[i] = arr[i + 2]; } return [displayed, more]; } // Exemple : const input = new Uint8Array([1, 2, 3, 4, 5, 6]); const [displayed, more] = splitUint8ArrayManual(input);