eval vs subscript

Benchmark created on


Preparation HTML

<script>
  var foo = {
   prop: 1
  },
      str = 'prop';
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
subscript
foo[str];
ready
eval
eval('foo.' + str);
ready

Revisions

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