by adamkf on 5/13/25, 10:30 PM with 16 comments
by pjmlp on 5/14/25, 12:50 PM
It is always a matter of tooling, being able to easily look into whatever they might contain.
I guess at least JSON-RPC (which most REST is actually about) isn't as bad as SOAP.
by jiehong on 5/14/25, 7:47 AM
I’m unsure of the quality of parquet implementations for browsers [0], though.
by codelikeawolf on 5/14/25, 11:48 AM
by victorNicollet on 5/14/25, 9:37 AM
For most data visualization tasks, the dataset will be composed of 5% of JSON data and 95% of a small number of large arrays (usually Float32Array) representing data table columns. The JSON takes time to parse, but it is small, and the large arrays can be created in constant time from the ArrayBuffer of the HTTP response (on big-endian machines, this will be linear time for all except Uint8Array).
For situations where hundreds of thousands of complex objects must be transferred, we will usually pack those objects as several large arrays instead. For example, using a struct-of-arrays instead of an array-of-structs, and/or by having an Uint8Array contain the result of a binary serialization of each object, with an Uint32Array containing the bounds of each object. The objective is to have the initial parsing be nearly instantaneous, and then to extract the individual objects on demand: this minimizes the total memory usage in the browser, and in the (typical) case where only a small subset of objects is being displayed or manipulate, the parsing time is reduced to only that subset instead of the entire response.
The main difficulty is that the browser developer tools "network" tab does not properly display non-JSON values, so investigating an issue requires placing a breakpoint or console.log right after the parsing of a response...
by naikrovek on 5/14/25, 5:58 PM
I doubt this a lot. Even turning a small JSON message into a pre-defined character-delimited string is at least an order of magnitude faster than JSON. In my testing, at least. in my testing over the years, JSON has always been the slowest thing to extract information out of, no matter how you approach it. And any binary format will be faster than just about any text format.
developers think binary stuff is scary, or somehow harder than text, but it isn't. binary is faster, smaller, and depending on your use case, more flexible.
I use type-length-value for just about everything binary. it's easy to understand later with a hex editor if you need to, but obviously documentation helps understanding this greatly. and no documentation for these format is the code which reads it.
binary formats. good. try it. tell your friends.
by zigzag312 on 5/14/25, 8:17 AM
by broken_broken_ on 5/14/25, 5:58 AM
I could also see video games and observability platforms needing to do this, for example Datadog, which must send lots of stack traces with long function names along with numerical data.
by avmich on 5/14/25, 7:59 PM
by mannyv on 5/14/25, 1:58 AM