Skip to content

Transition json_escape/5 to 4-arity after escaping - #475

Merged
josevalim merged 1 commit into
phoenixframework:mainfrom
preciz:optimize-json-escape
Sep 4, 2026
Merged

Transition json_escape/5 to 4-arity after escaping#475
josevalim merged 1 commit into
phoenixframework:mainfrom
preciz:optimize-json-escape

Conversation

@preciz

@preciz preciz commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Assisted-by: Antigravity CLI:Gemini 3.8 Flash

After finalizing a chunk, transition back to json_escape/4 instead of passing 0 to json_escape/5. This avoids redundant binary_part/3 calls on consecutive escape characters and reduces VM register overhead. This aligns json_escape with html_escape and improves performance.

After finalizing a chunk, transition back to json_escape/4 instead of passing 0 to json_escape/5. This avoids redundant binary_part/3 calls on consecutive escape characters and reduces VM register overhead. This aligns json_escape with html_escape and improves performance.
@josevalim
josevalim merged commit 7cbed82 into phoenixframework:main Sep 4, 2026
2 checks passed
@josevalim

Copy link
Copy Markdown
Member

💚 💙 💜 💛 ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants