Re: generic options for explain - Mailing list pgsql-hackers

From Dimitri Fontaine
Subject Re: generic options for explain
Date
Msg-id 87y6sjzy0i.fsf@hi-media-techno.com
Whole thread Raw
In response to Re: generic options for explain  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
Hi,

Peter Eisentraut <peter_e@gmx.net> writes:
> I was actually looking for a C library for JSON (json type for PostgreSQL; you 
> know it is coming :-) ), but only found a library tied to glib, which, 
> considering the experience with libxml, did not excite me.  If someone knows 
> of a different, small, and independent JSON library for C, I would like to 
> hear about it.

Looking at http://json.org/, it seems this particular project could fit:
 http://lloyd.github.com/yajl/
 Yet Another JSON Library. YAJL is a small event-driven (SAX-style) JSON parser written in ANSI C, and a small
validatingJSON generator. YAJL is released under the BSD license.
 
 ...
 It's all ANSI C. It's been successfully compiled on debian linux, OSX 10.4 i386 & ppc, OSX 10.5 i386, winXP, FreeBSD
4.10,FreeBSD 6.1 amd64, FreeBSD 7 i386, and windows vista. More platforms and binaries as time permits. 
 
 ...
 A second motivation for writing YAJL, was that many available free JSON parsers fall over on large or complex inputs.
YAJLis careful to minimize memory copying and input re-scanning when possible. The result is a parser that should be
fastenough for most applications or tunable for any application. On my mac pro (2.66 ghz) it takes 1s to verify a 60meg
jsonfile. Minimizing that same file with json_reformat takes 4s. 
 
 Largely because YAJL deals with streams, it's possible to parse JSON in low memory environments. Oftentimes with other
parsersan application must hold both the input text and the memory representation of the tree in memory at one time.
WithYAJL you can incrementally read the input stream and hold only the in memory representation. Or for filtering or
validationtasks, it's not required to hold the entire input text in memory. 
 


Hope this helps, regards,
-- 
dim


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: PostgreSQL Developer meeting minutes up
Next
From: Pavel Stehule
Date:
Subject: problem with memory