jsmn.nim icon indicating copy to clipboard operation
jsmn.nim copied to clipboard

Accept memory maps and streams

Open Varriount opened this issue 7 years ago • 3 comments

Memory maps for large JSON files would be nice to have, as well as support for some sort of streaming mechanism (for things like sockets).

Varriount avatar May 22 '17 06:05 Varriount

can you explain more about these terms? Im not fimiliar with them. thank you

ba0f3 avatar Nov 18 '17 20:11 ba0f3

Well, currently the parsing procedures take in a string containing the entire file, and output a sequence containing all the json nodes.

While this works well for most cases, it breaks down when one is using a data stream containing an unknown amount of json data (like if a client is sending data to a server over a socket).

Memory mapped files are less of an issue. If a document is very big, it is sometimes more convenient to load it into memory using a memory mapping.

Varriount avatar Nov 19 '17 07:11 Varriount

thank you, I will read mroe about it

ba0f3 avatar Nov 19 '17 09:11 ba0f3