convert string to char-code array (v39)

Revision 39 of this benchmark created by Chris on


Setup

var line = "This is the test string";
    var ca = new Array(line.length);
    var cc = [];

Teardown


    cc = [];
  

Test runner

Ready to run.

Testing in
TestOps/sec
loop through array
for(var i = 0; i < line.length; ++i)
        ca[i] = line.charCodeAt(i);
ready
array.push
for(var i = 0; i < line.length; ++i)
        cc.push(line.charCodeAt(i));
ready

Revisions

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