Collecting data about cbor time
This commit is contained in:
@@ -26,7 +26,8 @@ namespace Example.Frontend
|
||||
if (value)
|
||||
{
|
||||
Console.BackgroundColor = ConsoleColor.Green;
|
||||
}else Console.BackgroundColor = ConsoleColor.Gray;
|
||||
}
|
||||
else Console.BackgroundColor = ConsoleColor.Gray;
|
||||
|
||||
Console.Write($"{field.Name}");
|
||||
Console.BackgroundColor = ConsoleColor.Black;
|
||||
|
||||
@@ -10,11 +10,11 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||
<DefineConstants>TRACE;</DefineConstants>
|
||||
<DefineConstants>TRACE;JUST_LOAD</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
||||
<DefineConstants></DefineConstants>
|
||||
<DefineConstants>JUST_LOAD</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -45,6 +45,7 @@ class Program
|
||||
Console.WriteLine(builder.GetModule<IEndPointContext>().HostId);
|
||||
var context = builder.GetModule<RemoteInstanceRepository>();
|
||||
|
||||
#if !JUST_LOAD
|
||||
var factory =
|
||||
context.GetSingletonObject<IPrinterFactory>(
|
||||
builder.GetModule<IEndPointContext>());
|
||||
@@ -111,11 +112,11 @@ class Program
|
||||
}
|
||||
|
||||
DemoCheck.Dispose = true;
|
||||
|
||||
#endif
|
||||
|
||||
var loadSingleton = context.GetSingletonObject<ILoadTest>(builder.GetModule<IEndPointContext>());
|
||||
|
||||
|
||||
#if !JUST_LOAD
|
||||
var cts = new CancellationTokenSource();
|
||||
var token = cts.Token;
|
||||
var t = Task.Run(async () => await loadSingleton!.AsyncTest(token));
|
||||
@@ -124,7 +125,8 @@ class Program
|
||||
cts.Cancel();
|
||||
Console.WriteLine($"Token state {cts.Token.IsCancellationRequested}");
|
||||
DemoCheck.TaskCancelation = true;
|
||||
|
||||
#endif
|
||||
|
||||
const int iterations = 10000;
|
||||
var timer = Stopwatch.StartNew();
|
||||
var x = 0;
|
||||
@@ -137,6 +139,7 @@ class Program
|
||||
Console.WriteLine("X is {0}", x);
|
||||
Console.WriteLine("Time : {0}", timer.Elapsed.TotalMilliseconds);
|
||||
Console.WriteLine($"Time per call: {timer.Elapsed.TotalMilliseconds / iterations} ms");
|
||||
Console.WriteLine($"Serialization time: {CborSerializationToolkit.SerializationTime}");
|
||||
|
||||
frontendBridge.Disconnect();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user