From 95ec6767fa86e823bc21900b7c157604ddb3e647 Mon Sep 17 00:00:00 2001 From: Mitrofanov Mikhail Date: Sun, 13 Jul 2025 11:48:49 +0300 Subject: [PATCH] Performance issue solved, fully works with Microsoft DI --- Example.Backend/Example.Backend.csproj | 3 +++ Example.Backend/LoadTestImp.cs | 1 - Example.Load/Example.Load.csproj | 4 ++++ Example.Load/Program.cs | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Example.Backend/Example.Backend.csproj b/Example.Backend/Example.Backend.csproj index 2306674..70c6be2 100644 --- a/Example.Backend/Example.Backend.csproj +++ b/Example.Backend/Example.Backend.csproj @@ -8,10 +8,13 @@ enable 9 + + true TRACE + x64 diff --git a/Example.Backend/LoadTestImp.cs b/Example.Backend/LoadTestImp.cs index 9c6441b..4bd8ad0 100644 --- a/Example.Backend/LoadTestImp.cs +++ b/Example.Backend/LoadTestImp.cs @@ -12,7 +12,6 @@ namespace Example.Backend public static int N; public Task Next(int last) { - Console.WriteLine(++N); return Task.FromResult( last + 1); } diff --git a/Example.Load/Example.Load.csproj b/Example.Load/Example.Load.csproj index 71a5437..94ce3a1 100644 --- a/Example.Load/Example.Load.csproj +++ b/Example.Load/Example.Load.csproj @@ -9,6 +9,10 @@ true + + x64 + + diff --git a/Example.Load/Program.cs b/Example.Load/Program.cs index 273afc3..36be5f4 100644 --- a/Example.Load/Program.cs +++ b/Example.Load/Program.cs @@ -30,7 +30,7 @@ await Task.WhenAll(tasks); Console.WriteLine("End waiting"); var totalRequests = tasks.Sum(i => i.Result); -Console.WriteLine($"Total requests: {totalRequests}"); +Console.WriteLine($"Total requests: {totalRequests:N0}"); Console.WriteLine($"Results: {totalRequests / time.TotalSeconds:N} RPS");