Benchmark

This commit is contained in:
Tiago Conceição
2020-10-10 04:42:40 +01:00
parent 4208f49fe5
commit 383ac51224
6 changed files with 653 additions and 17 deletions
+13 -14
View File
@@ -182,6 +182,18 @@ namespace UVtools.GUI.Forms
progressBar.Style = ProgressBarStyle.Blocks;
}
private void UpdateResults(bool isSingleThread, long milliseconds)
{
decimal seconds = Math.Round(milliseconds / 1000m, 2);
//var text = (isSingleThread ? "Single" : "Multi") + $" Thread: {Math.Round(SingleThreadTests / seconds, 2)} OPS ({seconds}s)";
if(isSingleThread)
lbSingleThreadResults.Text = $"Single Thread: {Math.Round(SingleThreadTests / seconds, 2)} {RunsAbbreviation} ({SingleThreadTests} tests / {seconds}s)";
else
lbMultiThreadResults.Text = $"Multi Thread: {Math.Round(MultiThreadTests / seconds, 2)} {RunsAbbreviation} ({MultiThreadTests} tests / {seconds}s)"; ;
}
#region Tests
public byte[] EncodeCbddlpImage(Mat image, byte bit = 0)
{
List<byte> rawData = new List<byte>();
@@ -238,7 +250,7 @@ namespace UVtools.GUI.Forms
// Collect stragglers
AddRep();
return rawData.ToArray();
}
@@ -385,19 +397,6 @@ namespace UVtools.GUI.Forms
return rawData.ToArray();
}
private void UpdateResults(bool isSingleThread, long milliseconds)
{
decimal seconds = Math.Round(milliseconds / 1000m, 2);
//var text = (isSingleThread ? "Single" : "Multi") + $" Thread: {Math.Round(SingleThreadTests / seconds, 2)} OPS ({seconds}s)";
if(isSingleThread)
lbSingleThreadResults.Text = $"Single Thread: {Math.Round(SingleThreadTests / seconds, 2)} {RunsAbbreviation} ({SingleThreadTests} tests / {seconds}s)";
else
lbMultiThreadResults.Text = $"Multi Thread: {Math.Round(MultiThreadTests / seconds, 2)} {RunsAbbreviation} ({MultiThreadTests} tests / {seconds}s)"; ;
}
#region Tests
public Mat RandomMat(int width, int height)
{
var bytes = new byte[width * height];