-
Notifications
You must be signed in to change notification settings - Fork 156
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 LoggingStream. #142
base: main
Are you sure you want to change the base?
Conversation
@@ -24,26 +27,36 @@ public static async Task Main(string[] args) | |||
|
|||
services.AddSignalR(); | |||
|
|||
services.TryAddSingleton<ObjectPoolProvider, DefaultObjectPoolProvider>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels like an unnecessary dependency
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean using the String builder pool?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The LoggingStream
creates two new StringBuilder
s for every message that it logs. Why wouldn't you optimized that?
Optimization of the
LoggingStream
.StringBuilder
Pool.in
keyword.char
instead of astring
when appending to theStringBuilder
.Clean and conflict free version of #134