Re: Speed up JSON escape processing with SIMD plus other optimisations
Melih Mutlu <m.melihmutlu@gmail.com>
From: Melih Mutlu <m.melihmutlu@gmail.com>
To: David Rowley <dgrowleyml@gmail.com>
Cc: Andrew Dunstan <andrew@dunslane.net>, PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Date: 2024-06-11T12:08:29Z
Lists: pgsql-hackers
Hi David,
Thanks for the patch.
In 0001 patch, I see that there are some escape_json() calls with
NUL-terminated strings and gets the length by calling strlen(), like below:
- escape_json(&buf, "timestamp");
> + escape_json(&buf, "timestamp", strlen("timestamp"));
Wouldn't using escape_json_cstring() be better instead? IIUC there isn't
much difference between escape_json() and escape_json_cstring(), right? We
would avoid strlen() with escape_json_cstring().
Regards,
--
Melih Mutlu
Microsoft
Commits
-
Optimize JSON escaping using SIMD
- ca6fde92258a 18.0 landed
-
Optimize escaping of JSON strings
- 17a5871d9d58 18.0 landed