-
Notifications
You must be signed in to change notification settings - Fork 5k
Optimize memory allocations (#98702) #99542
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
Optimize memory allocations (#98702) #99542
Conversation
14b9674
to
7b0968f
Compare
src/libraries/Microsoft.Extensions.Logging.Console/src/JsonConsoleFormatter.cs
Outdated
Show resolved
Hide resolved
…m/shatl/dotnet-runtime into feature/98702-Memory-optimization
@MichalPetryka Could you take a look, please? |
src/libraries/Microsoft.Extensions.Logging.Console/src/JsonConsoleFormatter.cs
Outdated
Show resolved
Hide resolved
@cd21h could you please resolve the source conflict to be able to proceed? Also, for my comment #99542 (review) feel free to address it or if you want can address it in another PR. Thanks! |
a1acfd4
to
6329581
Compare
@cd21h I have pushed a commit for optimizing the other case in addition to merging main to your branch. Please have a look and let me know if it makes sense to you. Also, could you please accept the license agreement too #99542 (comment)? Thanks! |
…m/shatl/dotnet-runtime into feature/98702-Memory-optimization # Conflicts: # src/libraries/Microsoft.Extensions.Logging.Console/src/JsonConsoleFormatter.cs
@dotnet-policy-service agree |
@tarekgh Looks good to me! |
src/libraries/Microsoft.Extensions.Logging.Console/src/JsonConsoleFormatter.cs
Outdated
Show resolved
Hide resolved
src/libraries/Microsoft.Extensions.Logging.Console/src/JsonConsoleFormatter.cs
Outdated
Show resolved
Hide resolved
* Optimize memory allocations (dotnet#98702) * Use `UTF8.GetMaxCharCount` * Optimize memory allocations (dotnet#98702) * Use `UTF8.GetMaxCharCount` * Optimize netfx/netstandard 2.0 cases too * Fix formatting * Fix build error --------- Co-authored-by: Tarek Mahmoud Sayed <tarekms@microsoft.com>
Use
ArrayPool
to reduce memory allocations when writing JSON