Closures vs Prototypes

Benchmark created by Oliver Caldwell on


Description

This is testing initialising methods within a class or via the prototype.

Preparation HTML

<script src="https://gist.github.com/raw/10bd35333fbd477b2a41/63c89c99444205cb82c778580bfc54ce1ef8f3be/Script.Closure.js"></script>
<script src="https://gist.github.com/raw/10bd35333fbd477b2a41/5ad6305de4af98a079baf5f7a0528aa056a5b712/Script.Prototype.js"></script>

Test runner

Ready to run.

Testing in
TestOps/sec
Closures
var myScript = new ScriptC();
ready
Prototypes
var myScript = new ScriptP();
ready

Revisions

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

  • Revision 1: published by Oliver Caldwell on