Re: more efficient JSON encoding: idle musing

Carl Edquist <[email protected]> Fri, 21 Feb 2020 08:59:38 -0600 (CST)
Newsgroups gmane.comp.db.sqlite.general
Message-ID <[email protected]>
> If you have example code for a mechanism that is more space efficient 
> and/or faster, please share it with us.

"Bencode" is approximately the same space-wise as JSON, but 
encoding/decoding is potentially faster since it doesn't have to do any 
escaping for strings:

 	https://en.wikipedia.org/wiki/Bencode


On Fri, 21 Feb 2020, Richard Hipp wrote:

> On 2/21/20, Wout Mertens <[email protected]> wrote:
>> The idea is that upon storing the JSON
>> data, the JSON1 extension parses it, extracts the layouts recursively,
>> stores them when they are not known yet, and then only stores the
>> values in the binary format with the layout identifiers.
>
> I experimented with a number of similar ideas for storing JSON when I
> was first designing the JSON components for SQLite.  I was never able
> to find anything that was as fast or as compact as just storing the
> original JSON text.  But I could have overlooked something.  If you
> have example code for a mechanism that is more space efficient and/or
> faster, please share it with us.
>
> -- 
> D. Richard Hipp
> [email protected]
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users