Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Uint16Array vs Array
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/141.0.0.0 Safari/537.36
Browser:
Chrome 141
Operating system:
Linux
Device Platform:
Desktop
Date tested:
7 months ago
Test name
Executions per second
Uint16Array
27906.6 Ops/sec
Array
789938.4 Ops/sec
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
function cell1(width, height, cols, rows, x, y) { // mainly meant for the drawImage function (spread at arguments[1]) let w = height / rows, h = width / cols return Uint16Array.of(w * x % width, h * y % height, w, h) } function cell2(width, height, cols, rows, x, y) { // mainly meant for the drawImage function (spread at arguments[1]) let w = height / rows, h = width / cols return [w * x % width, h * y % height, w, h] }
Tests:
Uint16Array
for(let i = 1000; i--;) { let {0: x, 1: y, 2: width, 3: height} = cell1(100,100,10,10, i, i)}
Array
for(let i = 1000; i--;) { let {0: x, 1: y, 2: width, 3: height} = cell2(100,100,10,10, i, i)}