Re: patch: Add JSON datatype to PostgreSQL (GSoC, WIP) - Mailing list pgsql-hackers

From Robert Haas
Subject Re: patch: Add JSON datatype to PostgreSQL (GSoC, WIP)
Date
Msg-id AANLkTikUiG5qk9ZVh6Mnh0b8CwKfzQkjHuSd=i=zVc_8@mail.gmail.com
Whole thread Raw
In response to Re: patch: Add JSON datatype to PostgreSQL (GSoC, WIP)  (Terry Laurenzo <tj@laurenzo.org>)
List pgsql-hackers
On Sun, Nov 21, 2010 at 12:31 AM, Terry Laurenzo <tj@laurenzo.org> wrote:
> What we see from this is that parsing JSON text and generating a binary
> representation is cheap, representing approximately 10% of the base case
> time.  Conversely, anything that involves generating JSON text is expensive,
> accounting for 30-40% of the base case time.  Some incidental profiling
> shows that while the entire operation is expensive, the process of
> generating string literals dominates this time.  There is likely room for
> optimization in this method, but it should be noted that most of these
> documents are lightly escaped (if escaped at all) which represents the happy
> path through the string literal output function.

Ouch!  That's kind of painful.  But certainly for some use cases it
will work out to a huge speedup, if you're doing subscripting or
similar.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: ALTER OBJECT any_name SET SCHEMA name
Next
From: Robert Haas
Date:
Subject: Re: Latches with weak memory ordering (Re: max_wal_senders must die)