c++ - Memory consumption during parsing of YAML with yaml-cpp -


i developing qt application embedded system limited memory. need receive few megabytes of json data , parse fast possible , without using memory.

i thinking using streams:

json source (http client) ---> zip decompressor ---> yaml parser ----> objects mapped database

data arrive network slower can parse it.

  1. how memory yaml-cpp need parse 1mb of data?
  2. i parsed raw data decompressor , internal memory used data yaml parser released object mapped database created. possible?
  3. does yaml-cpp support asynchronous parsing? json object parsed, can store in database without waiting full content http source.

since have memory constraints , data in json, should use low-memory json parser instead of yaml parser. try jsoncpp - although i'm not sure support streaming (since json doesn't have concept of documents).

yaml-cpp is designed streaming, won't block if there documents parse stream still open; however, there outstanding issue in yaml-cpp reads more single document @ time, isn't designed extremely low memory usage.

as how memory takes parse 1 mb of data, on order of 3 mb (the raw input stream, plus parsed stream, plus resulting data structure), may vary dramatically depending on kind of data you're parsing.


Comments

Popular posts from this blog

how to proxy from https to http with lighttpd -

android - Automated my builds -

python - Flask migration error -