mef_js_1

JavaScript performance comparison

Test case created by mef

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
js1
// async test
var getRandomHex = function() {
  var e = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, "a", "b", "c", "d", "e", "f"],
    t = Math.floor(Math.random() * 16);
  return e[t];
};

var getUuid = function() {
  var e = "";
  for (var t = 0; t < 40; t++) e += getRandomHex();
  return e
}

console.log(getUuid());
pending…
js2
// async test
var getRandomInt = function (min, max) { return Math.floor(Math.random() * (max - min + 1)) + min;}

var getUuid2 = function(){

    var e = "";

    for (var i = 0; i < 40; i++) {
        e += getRandomInt(0,15).toString(16);
    }

    return e;
}
console.log(getUuid2());
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

Add a comment