test

JavaScript performance comparison

Test case created by DanielRuf

Test runner

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

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
1
length = length || 6;
  return Math.round((Math.pow(36, length + 1) - Math.random() * Math.pow(36, length))).toString(36).slice(1);
pending…
2
length = length || 6;
  var string = "";
  var chars = "0123456789abcdefghijklmnopqrstuvwxyz";
  for (var i = 0; i < length; i++) {
    string += chars[Math.floor(Math.random() * 36)];
  }
  return string;
pending…
3
length = length || 6;
  var string = [];
  var chars = "0123456789abcdefghijklmnopqrstuvwxyz";
  for (var i = 0; i < length; i++) {
    string.push(chars[Math.floor(Math.random() * 36)]);
  }
  return string;
pending…
4
length = length || 6;
  var string = [];
  var chars = "0123456789abcdefghijklmnopqrstuvwxyz".split('');
  for (var i = 0; i < length; i++) {
    string.push(chars[Math.floor(Math.random() * 36)]);
  }
  return string;
pending…
5
length = length || 6;
  var string = "";
  var chars = "0123456789";
  for (var i = 0; i < length; i++) {
    string += Math.floor(Math.random() * 10);
  }
  return string.toString(36);
pending…

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

Compare results of other browsers

0 Comments