Skip to content

Commit 9487997

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

6 files changed

Lines changed: 655 additions & 165 deletions

File tree

‎NEWS‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ PHP NEWS
5454
- MySQLnd:
5555
. Fixed field_count not resetting on OK packet. (Kamil Tekiela)
5656

57+
- JSON:
58+
. Added a vectorized (SSE2/NEON) fast path to php_json_escape_string()
59+
that bulk-copies runs of bytes which need no escaping, speeding up
60+
json_encode() on ASCII-heavy strings. (adapik)
61+
5762
- Opcache:
5863
. Fixed range inference of assignments through typed references.
5964
(Ilia Alshanetsky)

‎UPGRADING‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,13 @@ PHP 8.7 UPGRADE NOTES
9696
14. Performance Improvements
9797
========================================
9898

99+
- JSON:
100+
. Improve performance of encoding arrays and objects.
101+
. Improved performance of indentation generation in json_encode()
102+
when using PHP_JSON_PRETTY_PRINT.
103+
. Added an SSE2/NEON fast path for encoding strings that need no
104+
escaping, speeding up json_encode() on ASCII-heavy payloads.
105+
99106
- Standard:
100107
. Improved performance of strcspn() and strpbrk() when searching longer strings
101108
with a single-byte character mask.

0 commit comments

Comments
 (0)