7 ms·
I wonder why round-trip is such a small concern for people implementing serializers/deserializers of various kinds. I usually throw in an "Unknown" node type, w
by joachimma 11mo ago
I wonder why round-trip is such a small concern for people implementing serializers/deserializers of various kinds.
I usually throw in an "Unknown" node type, which stores things unaltered until I can understand things again. The parsers I usually write are very small, so I haven't seen what issues comes up at scale, maybe there are dragons lurking .
- piker 11mo agoThis is the solution for that particular issue that Tritium uses. [NOTE: one dragon would be the memory consumption alluded to in the article.]
- robmccoll 11mo agoCould you intern strings? Seems like you're likely to see the same tags and attributes over and over.
- piker 11mo agoYes, and there are probably a lot of other clever ideas. But the better solution is probably just to implement more of the spec. Once you get through maybe 80% of the tags, you've eliminated 99.9% of the memory issue given their frequency distribution.