Skip to content
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

Use readNBytes in StringHttpMessageConverter when contentLength is available #30942

Conversation

kilink
Copy link
Contributor

@kilink kilink commented Jul 25, 2023

When the content length is known, use readNBytes on the InputStream in StringHttpMessageConverter, which avoids some extra copying and allocations.

This is essentially the same optimization as #30010.

…ailable

When the content length is known, use readNBytes on the InputStream in StringHttpMessageConverter, which avoids some extra copying and allocations.
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jul 25, 2023
@jhoeller jhoeller added in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Aug 3, 2023
@jhoeller jhoeller added this to the 6.0.12 milestone Aug 3, 2023
@sbrannen sbrannen self-assigned this Aug 4, 2023
@sbrannen sbrannen changed the title Use readNBytes in StringHttpMessageConverter when contentLength is available Use readNBytes in StringHttpMessageConverter when contentLength is available Aug 4, 2023
sbrannen added a commit that referenced this pull request Aug 4, 2023
@sbrannen sbrannen closed this in 7636eec Aug 4, 2023
@sbrannen
Copy link
Member

sbrannen commented Aug 4, 2023

This has been merged into 6.0.x and main in 7636eec and revised in c050642.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants