Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Uint16Array vs Array
(version: 1)
Comparing performance of:
Uint16Array vs Array
Created:
6 months ago
by:
Guest
Jump to the latest result
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)}
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Uint16Array
Array
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
5 months ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:145.0) Gecko/20100101 Firefox/145.0
Browser/OS:
Firefox 145 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Uint16Array
58461.7 Ops/sec
Array
247547.7 Ops/sec
Related benchmarks:
Array population test
Create 2D Array
Create Square 2D Array
Create Square 2D Array Extended
2D to 1D Test
named vs positional arguments v1
named vs positional arguments v2
transrorm template 3
testing array ops
Comments
Confirm delete:
Do you really want to delete benchmark?