Hacker News new | ask | show | jobs
by pestatije 1875 days ago
Json is the default go-to standard for web services nowadays. But it doesn't mean it is the best format for your requirements. I'm not sure what an audio transcription is exactly, but if you can "stream" it you don't need json at all. Just use some basic serializer and stream that instead.
1 comments

Audio transcription would mean speech to text. Once I get the json I need to do some modifications on it and store it in cloud as a json file. However to do that, I need to load it entirely in memory, make my changes and then write it to file.

The problem here I am facing is, when the object is loaded a lot of memory is used and the memory used is not freed fully, so the difference in this accumulates gradually. So I was looking for formats which can be processed without keeping the entire text in memory.

Right, i see two different problems here: json lib apparently leaking, and deciding best format for info transfer.

For the first one: look in specific json lib forums, ask there, check open issues, open issue. (all those stackoverflow questions/answers are really confusers, not helpers).

For the second one: so it's text, i'd transfer text then. It's too much text? Process it in chunks. Your final format is json? Encapsulate your text as json at the last final step.