3 ms·
If performance is a concern, why on earth are you using JSON. Just the absurd amount of string-integer conversions kill any hope of that.
by stefan_ 7y ago
If performance is a concern, why on earth are you using JSON. Just the absurd amount of string-integer conversions kill any hope of that.
- chrisseaton 7y ago> If performance is a concern, why on earth are you using JSON. Maybe JSON is what you get sent and you've got no control over that? Or JSON is what you want to expose and you've got no control over that either? You can want to achieve reasonable performance while still meeting external requirements.
- jstimpfle 7y agoYou shouldn't take major compromises to improve a 90 to a 100, if you could get a 1000 by simply choosing the right approach (like using binary when performance really matters).
- dodobirdlord 7y agoIf you're receiving JSON from outside of your system then the performance talk about converting to objects with fixed offsets and hashmaps with the same layout goes out the window, as you don't control the format.
- chrisseaton 7y agoYou can meet an expected format in a fast path, and have a slow path fallback where it doesn’t meet and expected format.
- jcranmer 7y agoJSON is effectively a data interchange format. And for data interchange formats, there are reasons to emit property names (for example, because you want humans to be able to read, and maybe even write it). The fact that you want to use JSON as your serialization format shouldn't require you to make your internal data formats use hash tables instead of structs.