compostable objects

JavaScript performance comparison

Test case created by Joshua Piccari


This is probably my most poorly designed test, wish I could delete it.

Preparation code

Benchmark.prototype.setup = function() {
    var coords = Array.apply(0, Array(1e4)).map(function() {
      return new Person('Alice');
    function Person(name) { = name;

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
Control (new object)
for (var i = 0; i < coords.length; i++) {
  coords[i] = new Person('Bob');
Direct overwrite
for (var i = 0; i < coords.length; i++) {
  coords[i].name = 'Bob';

Compare results of other browsers


You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:


Comment form temporarily disabled.

Add a comment