teststsetsetsetset

JavaScript performance comparison

Test case created

Preparation code

 
<script>
Benchmark.prototype.setup = function() {
    var str = new Array(1000).join("aoskdakodoa"),
        i = str.length,
        r = "";
};
</script>

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
1
i = str.length;

while (i--) {
  r += str[i];
}
pending…
2
var t = [].slice.call(str),
    l = i / 2 >>> 0,
    c = 0,
    tmp;

for (c = 0; c < l; ++c) {
  tmp = t[c];
  t[c] = t[l - 1 - c];
  t[l - 1 - c] = tmp;
}

r = t.join("");
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