String.fromCharCode Test

JavaScript performance comparison

Revision 8 of this test case created by

Preparation code

<script>
var chars = new Uint8Array(1024);       
for(var i = 0; i < chars.length; i++) 
    chars[i] = i & 0xFF; 
</script>
    

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
Using a loop
var s = "";
for(var i=0,l=chars.length; i<l; i++)
    s += String.fromCharCode(chars[i]);
pending…
Using apply
var s = String.fromCharCode.apply(null, chars);
pending…
Apply with window
var s = String.fromCharCode.apply(window, chars);
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.

0 Comments