to test the required time to execute any instruction in the browser (assuming you have chrome or chromium for Linux ) you can use the something similar to the following code :
// first open the inspector **ctrl+shift+i** then switch to the console tab to write the code
// or you can go to `tools > developer tools` then choose the console tab
// here is the code :
console.time('t1');
"foo bar baz".split(' ');
console.timeEnd('t1');
// result t1: 0.020ms
console.time('t2');
// you instructions here
JSON.parse('{"a":"foo","b":"bar","c":"baz"}');
console.timeEnd('t2');
// result t2: 0.046ms
it is clear that the first way is faster than the second way
note : to convert object string to JSON format you have to put both property and its value within ""
for example in our case :
a:"foo" should be "a":"foo"
b:"bar" should be "b":"bar" and so on
so the entire string ('{a:"foo",b:"bar",c:"baz"}' in the second way )
should be '{"a":"foo","b":"bar","c":"baz"}'