Variable, Object, Array access speed

Benchmark created on


Description

Checking the difference between variables, object properties, and array access speeds.

Setup

let x = 10;
let y = 20;

let obj = {x: 10, y:20};

let arr = [10, 20];

Test runner

Ready to run.

Testing in
TestOps/sec
Raw
let blah = x + y;
ready
Obj
let blah = obj.x + obj.y;
ready
Array
let blah = arr[0] + arr[1];
ready

Revisions

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