convert string to char-code array (v30)

Revision 30 of this benchmark created on


Setup

line = "This is the test string";
    cc = [];
    length = line.length;

Test runner

Ready to run.

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

Revisions

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