Re: [PATCH] Optimize json_lex_string by batching character copying
John Naylor <john.naylor@enterprisedb.com>
From: John Naylor <john.naylor@enterprisedb.com>
To: Nathan Bossart <nathandbossart@gmail.com>
Cc: Andres Freund <andres@anarazel.de>, Tom Lane <tgl@sss.pgh.pa.us>, Jelte Fennema <Jelte.Fennema@microsoft.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>,
Merlin Moncure <mmoncure@gmail.com>, Andrew Dunstan <andrew.dunstan@2ndquadrant.com>,
Stephen Frost <sfrost@snowman.net>
Date: 2022-08-31T03:50:39Z
Lists: pgsql-hackers
Attachments
- v10-0001-Optimize-JSON-lexing-of-long-strings.patch (text/x-patch) patch v10-0001
On Tue, Aug 23, 2022 at 1:03 PM John Naylor <john.naylor@enterprisedb.com> wrote: > > LGTM overall. My plan is to split out the json piece, adding tests for > that, and commit the infrastructure for it fairly soon. Here's the final piece. I debated how many tests to add and decided it was probably enough to add one each for checking quotes and backslashes in the fast path. There is one cosmetic change in the code: Before, the vectorized less-equal check compared to 0x1F, but the byte-wise path did so with < 32. I made them both "less-equal 31" for consistency. I'll commit this by the end of the week unless anyone has a better idea about testing. -- John Naylor EDB: http://www.enterprisedb.com
Commits
-
Speed up lexing of long JSON strings
- 0a8de93a48ce 16.0 landed
-
Add optimized functions for linear search within byte arrays
- e813e0e16852 16.0 landed
-
Build de-escaped JSON strings in larger chunks during lexing
- 3838fa269c15 16.0 landed
-
Simplify json lexing state
- 3de359f18f2b 16.0 landed