-
Notifications
You must be signed in to change notification settings - Fork 862
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
Avoid creating unnecessary intermediate strings #3415
Comments
Hello @paulomorgado, Thank you for taking the time to share your performance optimization findings! Since you are open to contributing a PR, please feel free to do so. Team will be happy to review it. Regards, |
Just under Is the code base covered in tests for all that? |
Your PR has been merged and will be included in the next preview release of the SDK. Thanks again for the contribution! |
Comments on closed issues are hard for our team to see. |
Describe the feature
I found in the code base code like this:
StringWriter
uses an internalStringBuilder
that will be used to produce astring
just to get theutf-8
bytes.Use Case
Creating objects that do not need to be created, not only uses memory and CPU to create them, but also causes GC work.
Proposed Solution
Consider using a
StreamWriter
instead:Other Information
If
IRequest.Content
was aArraySegment<byte>
, this:coulde be this:
which is one less
byte[]
allocation.Acknowledgements
AWS .NET SDK and/or Package version used
AWSSDK.KeyManagementService 3.7.300.52
Targeted .NET Platform
.NET 8
Operating System and version
Windows and Linux
The text was updated successfully, but these errors were encountered: