mirror of
https://github.com/FabInfra/capnproto-dotnetcore_Runtime.git
synced 2025-04-21 02:26:31 +02:00
perf. profiling
This commit is contained in:
parent
65e87e5aa9
commit
78a62ddf98
@ -9,11 +9,12 @@
|
|||||||
<DebugType>full</DebugType>
|
<DebugType>full</DebugType>
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
<PlatformTarget>x64</PlatformTarget>
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
|
<DefineConstants>SOTASK_PERF</DefineConstants>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Capnp.Net.Runtime" Version="1.3.89-gdebe76be89" />
|
<PackageReference Include="Capnp.Net.Runtime" Version="1.3.89-gdebe76be89" />
|
||||||
<PackageReference Include="CapnpC.CSharp.MsBuild.Generation" Version="1.3.89-gdebe76be89" />
|
<PackageReference Include="CapnpC.CSharp.MsBuild.Generation" Version="1.3.90-g65e87e5aa9" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -21,11 +21,27 @@ namespace CapnpProfile
|
|||||||
var payload = new byte[20];
|
var payload = new byte[20];
|
||||||
new Random().NextBytes(payload);
|
new Random().NextBytes(payload);
|
||||||
|
|
||||||
|
#if SOTASK_PERF
|
||||||
|
int counter = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
var result = await echoer.Echo(payload);
|
var result = await echoer.Echo(payload);
|
||||||
if (result.Count != payload.Length)
|
if (result.Count != payload.Length)
|
||||||
throw new InvalidOperationException("Echo server malfunction");
|
throw new InvalidOperationException("Echo server malfunction");
|
||||||
|
|
||||||
|
#if SOTASK_PERF
|
||||||
|
if (++counter == 1000)
|
||||||
|
{
|
||||||
|
counter = 0;
|
||||||
|
|
||||||
|
Console.WriteLine($"StrictlyOrderedTask performance statistics:");
|
||||||
|
Console.WriteLine($"AwaitInternal: max. {Capnp.Util.StrictlyOrderedTaskExtensions.Stats.AwaitInternalMaxOuterIterations} outer iterations");
|
||||||
|
Console.WriteLine($"AwaitInternal: max. {Capnp.Util.StrictlyOrderedTaskExtensions.Stats.AwaitInternalMaxInnerIterations} inner iterations");
|
||||||
|
Console.WriteLine($"OnCompleted: max. {Capnp.Util.StrictlyOrderedTaskExtensions.Stats.OnCompletedMaxSpins} iterations");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -240,6 +240,9 @@ namespace Capnp.Util
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Performance profiling statistics
|
||||||
|
/// </summary>
|
||||||
public static readonly Statistics Stats = new Statistics();
|
public static readonly Statistics Stats = new Statistics();
|
||||||
#endif
|
#endif
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user