JSON.parse vs String.split (v8)

Revision 8 of this benchmark created on


Preparation HTML

<script>
  var str = "one,two,three,four,dskjaflkjadsfkljasdfjalsfdjsaldjfalksjdflkasjdfklajsdfkjasfdjalksfdjklasjdflkajsdfklasdf";
  var arr = str.split(",");
  
  var jsonstr = JSON.stringify(arr);
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
JSON
var result = JSON.parse(jsonstr);
ready
Split()
var result = str.split(",");
for (var c = 0, l = result.length; c < l; c++) {
  result[c] = decodeURIComponent(result[c]);
}
ready

Revisions

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