json array vs comma delimit

Benchmark created on


Setup

var userArray = "[\"fun@fun.com\", \"whatever@what.com\"]",
        userString = "fun@fun.com,whatever@what.com";

Test runner

Ready to run.

Testing in
TestOps/sec
json
var currentUser = JSON.parse(userArray)[0];
ready
split
var currentUser = userString.split(",")[0];
ready

Revisions

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