What is Nostr?
mewj / Bartholomew Joyce⚡️🇫🇷
npub1fzd…z4dv
2023-04-15 14:32:35
in reply to nevent1q…j525

mewj on Nostr: Yeah, on this note, first JSON decoding of multiple events can be trivially ...

Yeah, on this note, first JSON decoding of multiple events can be trivially parallelized and second the rapidjson C++ lib is incredibly fast.

Finally, the biggest performance hit with this type of work is the heap allocator being used to allocate new memory for each object being decoded.

If you pre-allocate a bunch of space for the decoder output and use a format like rapidjson where the entire result uses one contiguous memory region it’ll be blazing fast without any need to make architectural changes to the protocol.
Author Public Key
npub1fzdvtqluxr8macqfthtndmzxg6864zcc0cc3lknzd8zwrq5ya5xq4yz4dv