Script Preparation code:
AخA
 
var chars = [239,15,2,1,227,15,118,2,68,63,49,59,56,90,0,44,15,143,1,206,15,251,7,255,56,15,43,2,206,15,225,0,255,74,15,135,3,255,56,15,74,1,71,15,0,3,255,74,15,92,1,242,15,172,8,44,15,63,0,107,15,194,1,242,15,5,1,224,15,118,2,65,15,184,11,255,17,63,49,59,56,234,6,71,15,90,0,218,15,180,3,224,15,243,0,255,56,15,42,3,218,15,237,0,161,15,235,2,255,56,15,74,1,255,8,15,3,9,65,15,84,0,86,15,215];
Tests:
  • For-loop

     
    var s = "";
    for(var i=0,l=chars.length; i<l; i++)
        s += String.fromCharCode(chars[i]);
  • String.fromCharCode.apply

     
    var s = String.fromCharCode.apply(null, chars);
  • loop: String cached

     
    var s = "";
    var S = String;
    for(var i=0,l=chars.length; i<l; i++)
        s += S.fromCharCode(chars[i]);
  • loop: String.fromCharCode cached

     
    var s = "";
    var f = String.fromCharCode;
    for(var i=0,l=chars.length; i<l; i++)
        s += f(chars[i]);
  • join: String.fromCharCode cached

     
    var s = new Array(chars.length);
    var f = String.fromCharCode;
    for(var i=0,l=chars.length; i<l; i++)
        s[i] = f(chars[i]);
    s = s.join('');
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    For-loop
    String.fromCharCode.apply
    loop: String cached
    loop: String.fromCharCode cached
    join: String.fromCharCode cached

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 8 months ago)
Mozilla/5.0 (Windows NT 5.1; rv:52.0) Gecko/20100101 Firefox/52.0
Firefox 52 on Windows XP
View result in a separate tab
Test name Executions per second
For-loop 197931.9 Ops/sec
String.fromCharCode.apply 539508.3 Ops/sec
loop: String cached 237576.6 Ops/sec
loop: String.fromCharCode cached 242205.9 Ops/sec
join: String.fromCharCode cached 214051.4 Ops/sec