bytedance / sonic-cpp

A fast JSON serializing & deserializing library, accelerated by SIMD.
Apache License 2.0
835 stars 101 forks source link

Proposal: more abstracted SAX handler for lots of JSON manipulates #63

Open liuq19 opened 1 year ago

liuq19 commented 1 year ago

SAX handler is necessary because it consumes less memory and has fast performance. especially based on SIMD skip. Now, sonic-cpp's handler is designed to parse the whole json, and lazysax is limited to only parsing the top level of json. There are many limits:

  1. not support load or skip according to the user-defined handler.
  2. can not check json type in sax.

We can add SkipOne(raw json), CheckOne(type) and other handler functions, to support lots of JSON manipulates, such as, merge json, cut json, and so on.