Moo-Resig-Ender-My-JS.CLASS (v24)

Revision 24 of this benchmark created by Mark Johnson on


Description

Comparing Mootools, John Resig, Ender & My.js class systems on calling a method that calls a super method. Check the scripts MooTest.js, JRTest.js, EnderTest.js, MyTest.js, JSFace and JS.CLASS

Preparation HTML

<script src="http://myjs.fr/my-class/example/MooClass.js"></script>
<script src="http://myjs.fr/my-class/example/JRClass.js"></script>
<script src="http://myjs.fr/my-class/example/EnderClass.js"></script>
<script src="http://myjs.fr/my-class/my.class.min.js"></script>
<script src="http://myjs.fr/my-class/example/MooTest.js"></script>
<script src="http://myjs.fr/my-class/example/JRTest.js"></script>
<script src="http://myjs.fr/my-class/example/EnderTest.js"></script>
<script src="http://myjs.fr/my-class/example/MyTest.js"></script>
<script src="//dl.dropbox.com/u/7677927/jsface.js"></script>
<script src="http://dl.dropbox.com/u/4382143/jsclass-test/jsfaceperson.js"</script>
<script src="//dl.dropbox.com/u/7677927/jsface.js"></script>
<script src="http://dl.dropbox.com/u/4382143/jsclass-test/core.js"></script>
<script src="http://dl.dropbox.com/u/4382143/jsclass-test/jsclasstest.js"></script>
<script src="http://dl.dropbox.com/u/7677927/oop-benchmark/lib/ptclass.js"></script>

<script>
var PTClassPerson = PTClass.create({
  initialize: function(name){
    this.name = name;
  },
  setAddress: function(country, city, street) {
    this.country = country;
    this.city = city;
    this.street = street;
  }
});

var PTClassFrenchGuy = PTClass.create(PTClassPerson, {
  initialize: function($super, name) {
    $super(name);
  },
  setAddress: function($super, city, street) {
    $super('France', city, street);
  }
});

var PTClassParisLover = PTClass.create(PTClassFrenchGuy, {
  initialize: function($super, name) {
    $super(name);
  },
  setAddress: function($super, street) {
    $super('Paris', street);
  }
});
</script>

<script>
  var mooJohn = new MooParisLover('Carla Bruni');
  var jrJohn = new JRParisLover('Carla Bruni');
  var enderJohn = new EnderParisLover('Carla Bruni');
  var myJohn = new MyParisLover('Carla Bruni');
  var jsfaceJohn = new JSFaceParisLover('Carla Bruni');
  var jsClassJohn = new JSClassParisLover('Carla Bruni');
  var ptClassJohn = new PTClassParisLover('Carla Bruni');
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Moo
mooJohn.setAddress('Matignon');
ready
John Resig
jrJohn.setAddress('Matignon');
ready
Ender
enderJohn.setAddress('Matignon');
ready
My.js
myJohn.setAddress('Matignon');
ready
JSFace.js
jsfaceJohn.setAddress('Matignon');
ready
JS.Class
jsClassJohn.setAddress('Matignon');
ready
PT
ptClassJohn.setAddress('Matignon');
ready

Revisions

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