JSON - Storing date vs storing date.toString

Benchmark created on


Preparation HTML

<script>
  var storage;
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Store raw date object
storage = JSON.stringify(new Date());
ready
Retrieve raw date object
JSON.parse(storage);
ready
Store date toString
storage = JSON.stringify(new Date().toString());
ready
Retrieve date toString
new Date(JSON.parse(storage));
ready

Revisions

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

  • Revision 1: published on
  • Revision 2: published by Sami Samhuri on
  • Revision 3: published by Dan Manastireanu on