Object versus Variable

Benchmark created on


Description

I was curious, is an object read/write faster than a normal variable. I doubt it is, but my curious must be satisfied.

Preparation HTML

<script>
  var obj = {
    test: "Hello, world!"
  };
  var test = "Hello, World!";
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Object write
obj.test = "Hello";
 
ready
Variable write
test = "Hello";
ready
Object read
obj.test;
ready
Variable read
test;
ready

Revisions

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