性能优化,减少Lambda闭包分配

This commit is contained in:
2024-12-12 10:55:17 +08:00
parent b34ac104ef
commit fb3c4ac5f6
3 changed files with 10 additions and 4 deletions

View File

@@ -181,7 +181,7 @@ public class MainHostedService : BackgroundService
new { = "耗时", = elapsedTime.ToString("F2") + " 秒" },
new
{
= "平均输出速度",
= "平均处理速度",
= (_context.OutputCount / elapsedTime).ToString("F2") + " 条记录/秒"
},
new { = "内存占用峰值", = _context.MaxMemoryUsage + " 兆字节" }