5 ms·
HN (and a lot of other places, really) has a large population of web or otherwise "web-heritage" developers, as well as those whose ventures into computing star
by userbinator 7y ago
HN (and a lot of other places, really) has a large population of web or otherwise "web-heritage" developers, as well as those whose ventures into computing started beside/before the web. I suspect the JSON promotion comes mostly from the former group, while the latter, of which I am a member, laments it roughly as much as we did the "XML craze" of the late 90s and early 2000s.
- cm2187 7y agoAnd a tiny minority I am proudly part of, who watches these debates about xml vs json or tabs vs whitespace with the same amusement than Mike Judge!
- xxs 7y agoIndeed, hand rolled fixed point network marshaling, preferably with delta encoding for time series alike data (or data that oscillates) is couple of orders of magnitude faster and but also significantly "smaller" than a double-string-double, counterpart. Getting ~1 byte per data point of time series is quite achievable.
- vbezhenar 7y agoHow do you encode floating point delta into one byte?
- thedance 7y agoYou can't, that's why they said fixed point. Time series data should probably never use floats, for the exact reason that delta-encoding is not effective.
- scottlamb 7y ago"Can't" is too strong a word. Depending on what your numbers represent, I'd think you could do one or more of: * have a shorter exponent and/or mantissa to make each number shorter and the overall series more repetitive. (maybe even skip the mantissa if you only care about order of magnitude! call it the opposite of fixed-point, or just storing the logarithm of the value, whatever terminology works for you...) * skip the sign bit for a non-negative series (e.g., deltas of a non-decreasing series), * use a variable-width bitstream encoding like exp-Golomb to represent the exponent and/or mantissa, * use run-length encoding if it's repetitive (after delta-encoding), * etc. One byte per value (or less!) is surely possible in some cases. But I've never done it myself and agree fixed-point sounds much more pleasant. One of my projects represents deltas of durations in units of 90,000ths of a second, varint-encoded. I much prefer that to dealing with float seconds.
- thedance 7y agoThere's also the XOR compression scheme described by Facebook: https://www.vldb.org/pvldb/vol8/p1816-teller.pdf https://www.vldb.org/pvldb/vol8/p1816-teller.pdf