Skip to content

Commit b387b4f

Browse files
committed
json: Add SSE2/NEON fast path for clean-string runs in php_json_escape_string()
1 parent c5003a7 commit b387b4f

6 files changed

Lines changed: 661 additions & 169 deletions

File tree

‎NEWS‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ PHP NEWS
3737
(Ilia Alshanetsky)
3838
. Added IntlNumberFormatter::createFromSkeleton() (GH-24165). (David Carlier)
3939

40+
- JSON:
41+
. Added a vectorized (SSE2/NEON) fast path to php_json_escape_string()
42+
that bulk-copies runs of bytes which need no escaping, speeding up
43+
json_encode() on ASCII-heavy strings. (adapik)
44+
4045
- Lexbor:
4146
. Merge patches lexbor/lexbor@8a14bc0 and lexbor/lexbor@f67ce4b, fixing a
4247
heap buffer overflow in :lexbor-contains() parsing and buffer overflows

‎UPGRADING‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,10 @@ PHP 8.7 UPGRADE NOTES
173173
target does not keep is now released at that assignment instead of after
174174
the last one.
175175

176+
- JSON:
177+
. Added an SSE2/NEON fast path for encoding strings that need no
178+
escaping, speeding up json_encode() on ASCII-heavy payloads.
179+
176180
- Standard:
177181
. Improved performance of strcspn() and strpbrk() when searching longer strings
178182
with a single-byte character mask.

0 commit comments

Comments
 (0)