Porting dbslayer's JSON parsing/encoding to Yajl (a streaming JSON parser and encoder library in ANSI C)

17 views
Skip to first unread message

brianmario

unread,
Jun 23, 2009, 1:07:18 AM6/23/09
to dbslayer
Any interest in porting the JSON encoding and parsing over to Yajl?
The parser works similar to a SAX parser. Firing callbacks on found
tokens in the stream. Also the encoder allows you to retrieve and
clear it's buffer at any time, meaning you can stream the response as
it's being generated.

I took a quick look at the dbslayer source, and from what I can tell
the JSON parsing/decoding is pretty well decoupled from the http
layer. Can anyone speak to how large of a refactor it might be? I may
be able to lend a hand.

I think using Yajl would even further increase dbslayer's scalability
(especially in terms of memory usage).

It's sources are available here: http://github.com/lloyd/yajl
Docs/Readme here: http://lloyd.github.com/yajl/

brianmario

unread,
Jun 23, 2009, 1:14:18 AM6/23/09
to dbslayer
I made ruby bindings to Yajl (http://github.com/brianmario/yajl-ruby),
so I may be able to lend a hand on it's usage and API. I also have a
couple of patches to Yajl (currently specific to yajl-ruby) regarding
continuous parsing and encoding of multiple JSON strings from/to the
same stream - if that's of any interest.
Reply all
Reply to author
Forward
0 new messages