3 ms·
Better design would be not allocating any memory based on the message content and do parsing with callbacks or iterator approach.
by megous 7y ago
Better design would be not allocating any memory based on the message content and do parsing with callbacks or iterator approach.
- stingraycharles 7y agoDepends on what your goals are as an API designer. If you want a fast and scalable approach, your suggestion would indeed be most appropriate. On the other hand, most users are likely best served with a parser that just returns a single object, which they then can interact with as they desire.
- indentit 7y agoCould that not be easily done as an add on that utilizes the callback approach? The parser library could offer both APIs and the caller could decide which to use and what to do when running out of memory etc.
- deleted 7y ago[deleted]