dotnet/aspnetcore

Write more content directly to StreamWriter in W3CLogger

Open

#33,946 创建于 2021年6月29日

在 GitHub 查看
 (6 评论) (0 反应) (0 负责人)C# (10,653 fork)batch import
Perfarea-networkinghelp wanted

仓库指标

Star
 (37,933 star)
PR 合并指标
 (平均合并 16天 9小时) (30 天内合并 258 个 PR)

描述

See https://github.com/dotnet/aspnetcore/pull/33251/#discussion_r655734742, https://github.com/dotnet/aspnetcore/pull/33251/#discussion_r656445769.

https://github.com/dotnet/aspnetcore/blob/3177376dca6ca0a6bba1d4ab946e77f02547c167/src/Middleware/HttpLogging/src/W3CLogger.cs#L49

Since we know the only consumer of this data is StreamWriter, can you delay the Format, enqueue the elements array, and format when writing to the stream? This intermediate string is likely large and useless.

https://github.com/dotnet/aspnetcore/blob/3177376dca6ca0a6bba1d4ab946e77f02547c167/src/Middleware/HttpLogging/src/W3CLoggerProcessor.cs#L35

More content that should be written directly to the streamWriter.

贡献者指南