var vs funct

Benchmark created on


Preparation HTML

<script>
  function a() {}
  a.prototype = {
   c1: true,
   c2: false,
   c3: true,
   c4: false,
   c5: true
  }
  
  function c() {}
  c.prototype.e1 = true;
  c.prototype.e2 = false;
  c.prototype.e3 = true;
  c.prototype.e4 = false;
  c.prototype.e5 = true;
  
  var b = function() {}
  b.prototype = {
   d1: true,
   d2: false,
   d3: true,
   d4: false,
   d5: true
  }
  
  var d = function() {}
  d.prototype.e1 = true;
  d.prototype.e2 = false;
  d.prototype.e3 = true;
  d.prototype.e4 = false;
  d.prototype.e5 = true;
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
var
var t = new b();
ready
funct
var t = new a();
ready
var indiv. proto
var t = new d();
ready
func indiv. proto
var t = new c();
ready

Revisions

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