Re: generic options for explain

From: Dimitri Fontaine <dfontaine(at)hi-media(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org, Dave Page <dpage(at)pgadmin(dot)org>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Subject: Re: generic options for explain
Date: 2009-05-26 15:26:05
Message-ID: 87y6sjzy0i.fsf@hi-media-techno.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Peter Eisentraut <peter_e(at)gmx(dot)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 validating JSON
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. YAJL is careful to
minimize memory copying and input re-scanning when possible. The
result is a parser that should be fast enough for most applications or
tunable for any application. On my mac pro (2.66 ghz) it takes 1s to
verify a 60meg json file. 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 parsers an
application must hold both the input text and the memory
representation of the tree in memory at one time. With YAJL you can
incrementally read the input stream and hold only the in memory
representation. Or for filtering or validation tasks, it's not
required to hold the entire input text in memory.

Hope this helps, regards,
--
dim

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2009-05-26 15:32:46 problem with memory
Previous Message Tom Lane 2009-05-26 15:19:42 Re: PostgreSQL Developer meeting minutes up