Skip to content

Optimize getContentLength for ASCII Strings #35290

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

kilink
Copy link
Contributor

@kilink kilink commented Aug 5, 2025

If the provided String contains only ASCII characters, and the target encoding is ASCII or an ASCII superset, avoid calling getBytes on the String and allocating a byte array unnecessarily.

If the provided String contains only ASCII characters, and the target
encoding is ASCII or an ASCII superset, avoid calling getBytes on the String
and allocating a byte array unnecessarily.

Signed-off-by: Patrick Strawderman <[email protected]>
@rstoyanchev
Copy link
Contributor

Closing for now as we're likely to try a different approach as per discussion under #35261.

@rstoyanchev rstoyanchev removed the status: waiting-for-triage An issue we've not yet triaged or decided on label Aug 13, 2025
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.

3 participants