<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>JSON on David Hamp-Gonsalves</title><link>https://davidhampgonsalves.com/tags/json/</link><description>Recent content in JSON on David Hamp-Gonsalves</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Thu, 07 Nov 2013 00:00:00 +0000</lastBuildDate><atom:link href="https://davidhampgonsalves.com/tags/json/index.xml" rel="self" type="application/rss+xml"/><item><title>Compressing JSON into a Brittle Lightweight String</title><link>https://davidhampgonsalves.com/compressing-json-into-a-brittle-lightweight-string/</link><pubDate>Thu, 07 Nov 2013 00:00:00 +0000</pubDate><guid>https://davidhampgonsalves.com/compressing-json-into-a-brittle-lightweight-string/</guid><description>&lt;p&gt;Client side single page apps tend to throw a lot of JSON data across the internet. These are some techniques I used on &lt;a href="http://crimeheatmap.ca"&gt;cimrheatmap.ca&lt;/a&gt; to compress my Geo/Time data by about &lt;strong&gt;90%&lt;/strong&gt; and avoided the overhead of gzipping the page. Be warned most of this was just for fun and is a silly idea because of the disadvantages listed bellow.
&lt;code&gt;{lat\:45.123, lng\:-63.123, type\: 'Assult', timestamp\: '1383837388112'}&lt;/code&gt; vs. &lt;code&gt;'3 0 '&lt;/code&gt;&lt;/p&gt;
&lt;h2 id="maps-vs-arrays"&gt;Maps vs. Arrays&lt;/h2&gt;
&lt;p&gt;Standard JSON compression usually focuses on flatening the maps that are normally used to represent objects. This removes all the duplciate keys.&lt;/p&gt;</description></item></channel></rss>