Object lookup

Benchmark created by Premasagar Rose on


Preparation HTML

<script>
  var obj = {
   foo: 99
  };
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
lookup
var i, result;

for (i = 0; i < 5000; i++) {
 result = obj.foo;
}
ready
cache var
var i, ref = obj.foo,
    result;

for (i = 0; i < 5000; i++) {
 result = ref;
}
ready

Revisions

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

  • Revision 1: published by Premasagar Rose on