4 ms·
(De-)Serialization being such a common task both in Servers and clients nowadays I wonder if special instructions would make sense in CPUs
by legulere 8y ago
(De-)Serialization being such a common task both in Servers and clients nowadays I wonder if special instructions would make sense in CPUs
- namibj 8y agoAt that point just base-64 for your IEEE floats.... Because anywhere where you need that speed you can better handle it without using strings...
- cryptonector 8y agoBut that's not necessarily interoperable. E.g., some JSON parsers might produce IEEE754 doubles, but others might use arbitrary precision representations -- what then? One answer is to make JSON support only IEEE754 doubles, but it's a bit late for that, so at most one can recommend that implementors stick to IEEE754. If you are starting from scratch, and want to support only platforms that support IEEE754 in hardware, and so on, then yes, just serialize the raw bits.
- pjc50 8y agoYou've just given me the idea that interop should be done with "hexponential" notation: 0x123ABC*0x10^0xDEF can be an exact representation of a floating point number.
- stephencanon 8y agoThat’s basically hexadecimal floating point strings, which are in C since C99 via the %a format specifier (they use a base-two exponent written in decimal instead of a base-16 exponent in hex, but that doesn’t really change the complexity of parsing or formatting.)
- namibj 8y agoThen support this as a fallback, and negotiate for IEEE754 binary support on the next higher level.
- pjc50 8y agohttps://stackoverflow.com/questions/50966676/why-do-arm-chips-have-an-instruction-with-javascript-in-the-name-fjcvtzs https://stackoverflow.com/questions/50966676/why-do-arm-chip... (not quite the same thing but heading in that direction)