Array vs object for position and dimension

Benchmark created on


Setup

var arr = [16,16,32,32]
    var obj = {x: 16, y: 16, w: 32, h:32}

Test runner

Ready to run.

Testing in
TestOps/sec
Arr width change
arr[2] = 48
ready
Obj width change
obj.w = 48
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.