Re: Speed up JSON escape processing with SIMD plus other optimisations

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: David Rowley <dgrowleyml(at)gmail(dot)com>, Melih Mutlu <m(dot)melihmutlu(at)gmail(dot)com>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Speed up JSON escape processing with SIMD plus other optimisations
Date: 2024-07-24 10:55:02
Message-ID: 97d106b2-38a6-49e8-910f-2636093a0b3b@iki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 02/07/2024 07:49, David Rowley wrote:
> I've attached a rebased set of patches. The previous set no longer applied.

I looked briefly at the first patch. Seems reasonable.

One little thing that caught my eye is that in populate_scalar(), you
sometimes make a temporary copy of the string to add the
null-terminator, but then call escape_json() which doesn't need the
null-terminator anymore. See attached patch to avoid that. However, it's
not clear to me how to reach that codepath, or if it reachable at all. I
tried to add a NOTICE there and ran the regression tests, but got no
failures.

--
Heikki Linnakangas
Neon (https://neon.tech)

Attachment Content-Type Size
avoid-possibly-unreachable-palloc.patch.txt text/plain 1.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2024-07-24 10:57:41 PG buildfarm member cisticola
Previous Message Laurenz Albe 2024-07-24 10:46:52 Re: Incremental backup from a streaming replication standby fails