Split Performance (v4)

Revision 4 of this benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
Split
var str = 'now later today tomorrow now later today tomorrow now later today tomorrow now later today tomorrow now later today tomorrow now later today tomorrow ';
var args = str.split(' ')
ready
Array
var str = 'now later today tomorrow now later today tomorrow now later today tomorrow now later today tomorrow now later today tomorrow now later today tomorrow ';
var pos = 0;
var args = [];
var res = "";

for (var i = 0; i < str.length; i++) {
  if (str.charAt(i) == ' ') {args[pos] = res; pos++; res = "";}
  else res += str.charAt(i);
}
ready

Revisions

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