Array vs object access (v2)

Revision 2 of this benchmark created on


Setup

var o = {from: 0, to: 1};
    var a = [0, 1];
    var from;
    var to;

Test runner

Ready to run.

Testing in
TestOps/sec
object square bracket
from = o['from'];
to = o['to'];
ready
array
from = a[0];
to = a[1];
ready
object dot
from = o.from;
to = o.to;
ready

Revisions

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