]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Speed up lexing of long JSON strings
authorJohn Naylor <john.naylor@postgresql.org>
Wed, 31 Aug 2022 03:39:17 +0000 (10:39 +0700)
committerJohn Naylor <john.naylor@postgresql.org>
Fri, 2 Sep 2022 02:36:22 +0000 (09:36 +0700)
commit0a8de93a48ce1e7479fb75fe10a8859559ec0c09
tree497ee333fbb408e740a0b539481f50e9401db81c
parent05519126a02ee39bf0957d3d85a1da5bd7e1c09c
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%40mail.gmail.com
Discussion: https://www.postgresql.org/message-id/CAFBsxsESLUyJ5spfOSyPrOvKUEYYNqsBosue9SV1j8ecgNXSKA%40mail.gmail.com
src/common/jsonapi.c
src/test/regress/expected/json.out
src/test/regress/sql/json.sql