palette.js_perf_test

JavaScript performance comparison

Test case created

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
cached
var ret = (function(proto) {
  return {
    slice: function(arr, opt_begin, opt_end) {
      return proto.slice.apply(arr, proto.slice.call(arguments, 1));
    },
    extend: function(arr, arr2) {
      proto.push.apply(arr, arr2);
    }
  };
})(Array.prototype);
var slice = ret.slice;
var extend = ret.extend;

var i = 0;
var arr1 = [1,2,3,4,5,6,7,8,9,10];
while(i < 10000) {
  var j = 0;
  while(j < 10) {
    slice(arr1,1,j);
    j++;
  }
  i++;
}

i = 0;
while(i < 10000) {
  extend(arr1,[]);
  i++;
}
pending…
not cached
var proto = Array.prototype;
var slice = function(arr,opt_begin,opt_end) {
  return proto.slice.apply(arr,proto.slice.call(arguments,1));
}
var extend = function(arr,arr2) {
  return proto.push.apply(arr,arr2);
}

var i = 0;
var arr1 = [1,2,3,4,5,6,7,8,9,10];
while(i < 10000) {
  var j = 0;
  while(j < 10) {
    slice(arr1,1,j);
    j++;
  }
  i++;
}

i = 0;
while(i < 10000) {
  extend(arr1,[]);
  i++;
}
pending…

Compare results of other browsers

Revisions

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:

0 comments

Add a comment