object prop access

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
no var
function sum(o){
  let t = 0;
  for(let i=1; i <= 10000; i++){
		t += o.a + o.b + o.c;
  }
  return t;
}

sum({a:1, b:22, c:33})
ready
with var
function sum(o){
  let t = 0;
  const a = o.a;
  const b = o.b;
  const c = o.c;
  
  for(let i=1; i <= 10000; i++){
		t += (a + b + c);
  }
  return t;
}

sum({a:1, b:22, c:33})
ready

Revisions

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