3 ms·
You can represent a table using JSON arrays, and I doubt CJS is "way faster" or smaller than gzipped JSON. There is nothing inherently preventing you from writ
by tlrobinson 10y ago
You can represent a table using JSON arrays, and I doubt CJS is "way faster" or smaller than gzipped JSON.
There is nothing inherently preventing you from writing an almost identically performing streaming JSON parser or serializer.
- proteusguy 10y agoThis is likely content coming down from an HTTP API so likely already gzipped. Since you can gzip both CSJ and JSON I think that's not really relevant. With this proposed format you only need to parse the object definition once and you also get the ordering fixed. From then on you need only validate each field in each line as being legal and you can build your object quite fast. This format saves probably half the network bandwidth, half or more in memory requirements, and more than half the cpu complexity in parsing and getting your final objects instantiated. That's pretty good. Remember the goal isn't to replace JSON. It's to replace CSV. JSON and CSV have different goals. This is simply a JSON structure built to meet the same goals as CSV. It seems to do that quite nicely and can use existing JSON parsers internally to do it. Pretty nifty.