This is really situational, because JSON.parse is really fast. With small workloads you will measure it in tens of microseconds. But it does block the event loop.
Agreed, parse is a lot faster than storage, but definitely can take more than 16.7ms with significant packets. You'd be trading performance for a smooth out, sometimes worth it with large packets. Should only be used if there is a glitch present I'd say.
This is really situational, because
JSON.parse
is really fast. With small workloads you will measure it in tens of microseconds. But it does block the event loop.Agreed, parse is a lot faster than storage, but definitely can take more than 16.7ms with significant packets. You'd be trading performance for a smooth out, sometimes worth it with large packets. Should only be used if there is a glitch present I'd say.
If it was an option, I'd also consider using
ndjson
to split up the JSON objects into manageable chunks to get the best of both worlds.