Property lookups

Benchmark created by Marshall Roch on


Preparation HTML

<script>
  function Foo() {}
  Foo.bar = function() { return +new Date(); };
  var bar = Foo.bar;
  
  Foo.now = function() { return Date.now(); };
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Lookup
Foo.bar()
ready
Memoize
bar();
ready
Direct
+new Date()
ready
Native alternative
Date.now()
ready
Date.now lookup
Foo.now()
ready

Revisions

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

  • Revision 1: published by Marshall Roch on