JSON.parse and JSON.stringify (v2)

Revision 2 of this benchmark created on


Description

Testing JSON.parse() and JSON.stringify() against the example from http://json.org/example.html

Preparation HTML

<script>
  var str = '{ "glossary": { "title": "example glossary", "GlossDiv": { "title": "S", "GlossList": { "GlossEntry": { "ID": "SGML", "SortAs": "SGML", "GlossTerm": "Standard Generalized Markup Language", "Acronym": "SGML", "Abbrev": "ISO 8879:1986", "GlossDef": { "para": "A meta-markup language, used to create markup languages such as DocBook.", "GlossSeeAlso": ["GML", "XML"] }, "GlossSee": "markup" } } } } }';
  
  var obj = JSON.parse(str);
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
JSON.parse
JSON.parse(str);
ready
eval
eval('('+str+')');
ready

Revisions

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