[Development] State of "binary JSON" in 5.15+?

Stottlemyer, Brett (B.S.) bstottle at ford.com
Tue Apr 13 15:43:10 CEST 2021


I was at the Contributor’s Summit where it was discussed, so I know there were good reasons to deprecate the binary json format.  The actual changes looks to have been done in https://codereview.qt-project.org/c/qt/qtbase/+/265312.

IIUC, the original intent was that parsing the JSON creates a lookup table to speed up subsequent access, and the binary format saved that table to disk (or for streaming).  This allowed “opening the JSON” (technically no longer JSON?) much more quickly.

Is such a mechanism still available currently?  Or is parsing the data from scratch necessary now?

For reference, I tried the deprecated calls and also used the conversion tool to convert to CBOR and tried reading that.  With a particular (~20MB) JSON file from a REST call, parsing the CBOR version of the file was about twice as fast as JSON, while the binary JSON format was about 2.5x *slower* than parsing the JSON (just measuring the document creation time).

FWIW, if the capability is no longer available, the overview for Qt JSON (https://doc.qt.io/qt-5/json.html) should probably have “It also contains support for saving this data in a binary format that is directly "mmap"-able and very fast to access” removed.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20210413/ea255421/attachment.html>

More information about the Development mailing list