pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: John Naylor <john.naylor@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Speed up lexing of long JSON strings
Date: Fri, 02 Sep 2022 02:48:56 +0000
Message-ID: <E1oTwjo-0011bl-FL@gemulon.postgresql.org> (raw)

Speed up lexing of long JSON strings

Use optimized linear search when looking ahead for end quotes,
backslashes, and non-printable characters. This results in nearly 40%
faster JSON parsing on x86-64 when most values are long strings, and
all platforms should see some improvement.

Reviewed by Andres Freund and Nathan Bossart
Discussion: https://www.postgresql.org/message-id/CAFBsxsGhaR2KQ5eisaK%3D6Vm60t%3DaxhD8Ckj1qFoCH1pktZi%2B2w%40ma...
Discussion: https://www.postgresql.org/message-id/CAFBsxsESLUyJ5spfOSyPrOvKUEYYNqsBosue9SV1j8ecgNXSKA%40mail.gma...

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0a8de93a48ce1e7479fb75fe10a8859559ec0c09

Modified Files
--------------
src/common/jsonapi.c               | 13 ++++++++++---
src/test/regress/expected/json.out | 13 +++++++++++++
src/test/regress/sql/json.sql      |  5 +++++
3 files changed, 28 insertions(+), 3 deletions(-)



Message-ID: <E1oTwjo-0011bl-FL@gemulon.postgresql.org>
Permalink:  ../E1oTwjo-0011bl-FL@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1oTwjo-0011bl-FL@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: john.naylor@postgresql.org
  Subject: Re: pgsql: Speed up lexing of long JSON strings
  In-Reply-To: <E1oTwjo-0011bl-FL@gemulon.postgresql.org>
  References: <E1oTwjo-0011bl-FL@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox