Run details:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Mobile Safari/537.36
Chrome Mobile 134
Android
Mobile
11 days ago
Test name Executions per second
JSON.parse() 107488.1 Ops/sec
eval() 770619.4 Ops/sec
Script Preparation code:
AخA
 
var jsonString = '{"user":{"id":1,"name":{"first":"太郎","last":"山田"},"age":30,"email":"taro.yamada@example.com","address":{"street":"1-2-3","city":"東京","prefecture":"東京都","postalCode":"100-0001"},"phoneNumbers":[{"type":"mobile","number":"090-1234-5678"},{"type":"home","number":"03-1234-5678"}],"hobbies":[{"name":"サッカー","level":"中級"},{"name":"読書","genres":["フィクション","ノンフィクション","ミステリー"]},{"name":"料理","skills":{"cuisine":["和食","イタリアン"],"level":"上級"}}],"preferences":{"language":"日本語","notifications":{"email":true,"sms":false,"push":true}}}}'
var jsonString2 = '({"user":{"id":1,"name":{"first":"太郎","last":"山田"},"age":30,"email":"taro.yamada@example.com","address":{"street":"1-2-3","city":"東京","prefecture":"東京都","postalCode":"100-0001"},"phoneNumbers":[{"type":"mobile","number":"090-1234-5678"},{"type":"home","number":"03-1234-5678"}],"hobbies":[{"name":"サッカー","level":"中級"},{"name":"読書","genres":["フィクション","ノンフィクション","ミステリー"]},{"name":"料理","skills":{"cuisine":["和食","イタリアン"],"level":"上級"}}],"preferences":{"language":"日本語","notifications":{"email":true,"sms":false,"push":true}}}})'
Tests:
  • JSON.parse()

     
    var dummy = JSON.parse(jsonString);
  • eval()

     
    var dummy = eval(jsonString2);