read from small object vs a deep object

Benchmark created on


Setup

var deepObj = [
    {
      "deepth": "deep1",
      "deep1": {
        "deepth": "deep2",
        "deep2": {
          "deepth": "deep3",
          "deep3": {
            "deepth4": "deep4",
            "deep4": {
              "deepth": "deep5",
              "deep5": {}
            }
          }
        }
      }
    }
    ];
    var obj = [{"deep1":{}}];

Test runner

Ready to run.

Testing in
TestOps/sec
deep
console.log(deepObj[0].deep1.deep2.deep3.deep4);
ready
not deep
console.log(obj[0].deep1);
ready

Revisions

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