convert string to char-code array (v22)

Revision 22 of this benchmark created by Cole on


Setup

line = "This is the test string";
    cc = [];
    for (var i = 0; i < line.length; ++i)
      cc[i] = line.charCodeAt(i);

Test runner

Ready to run.

Testing in
TestOps/sec
loop through array
var a = cc[3];
ready
array.push
var a = line.charCodeAt(3);
ready
array map
cc = line.split("").map(function(char) {
  return char.charCodeAt(0);
});
ready

Revisions

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