Skip to content

Conversation

adamradocz
Copy link
Contributor

@adamradocz adamradocz commented Feb 11, 2022

Optimization of the LoggingStream.

  • Add StringBuilder Pool.
  • Add in keyword.
  • Use char instead of a string when appending to the StringBuilder.

Clean and conflict free version of #134


services.AddSignalR();

services.TryAddSingleton<ObjectPoolProvider, DefaultObjectPoolProvider>();
Copy link
Owner

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

Copy link
Contributor Author

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?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

Copy link
Contributor Author

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 StringBuilders for every message that it logs. Why wouldn't you optimized that?

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.

2 participants