Javascript, storing files in JSON or in TSV for efficiency in reading and parsing?
<p>In my code I needed to read TSV (tab-formatted) data from different files and transform it to a single file to improve the user usability. At the moment of saving the file I am facing a decision:</p>

<ul>
<li>Store it in JSON format where I already have the object structure I need for the next logic</li>
<li>Store it again in TSV format and parse it again afterwards (or use a library such as <a href="http://papaparse.com/" rel="nofollow">http://papaparse.com/</a> or similar, don't really know what is available out there)</li>
</ul>

<p>I have tried the first option, thinking I would save the parsing time by directly reading in JSON. 
However, file sizes of JSON data are much higher than if stored in TSV format, and perhaps what I win in not parsing the data I lose in reading much more data.</p>

<p>There are libraries such as <a href="http://msgpack.org/" rel="nofollow">http://msgpack.org/</a> that could help in reducing JSON file size. And perhaps there are libraries for TSV that avoid me having to parse the data again (see above). And I really don't know how efficient is the JSON.parse function, maybe I am spending a long time there.</p>

<p>So the question would be, <strong>what is the best strategy when you have a javascript complex object and you want to save it in a file to read it later?</strong></p>

<ul>
<li>to store in JSON?</li>
<li>or to store in TSV?</li>
</ul>