diff --git a/UVtools.GUI/Forms/FrmBenchmark.cs b/UVtools.GUI/Forms/FrmBenchmark.cs index bba8f82..c3ddc94 100644 --- a/UVtools.GUI/Forms/FrmBenchmark.cs +++ b/UVtools.GUI/Forms/FrmBenchmark.cs @@ -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 rawData = new List(); @@ -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]; diff --git a/UVtools.WPF/MainWindow.axaml.cs b/UVtools.WPF/MainWindow.axaml.cs index 4183b40..8d7b901 100644 --- a/UVtools.WPF/MainWindow.axaml.cs +++ b/UVtools.WPF/MainWindow.axaml.cs @@ -618,6 +618,11 @@ namespace UVtools.WPF await new AboutWindow().ShowDialog(this); } + public async void MenuHelpBenchmarkClicked() + { + await new BenchmarkWindow().ShowDialog(this); + } + public async void MenuHelpInstallProfilesClicked() { var PEFolder = App.GetPrusaSlicerDirectory(); diff --git a/UVtools.WPF/Structures/BenchmarkTest.cs b/UVtools.WPF/Structures/BenchmarkTest.cs new file mode 100644 index 0000000..b349bbb --- /dev/null +++ b/UVtools.WPF/Structures/BenchmarkTest.cs @@ -0,0 +1,34 @@ +/* + * GNU AFFERO GENERAL PUBLIC LICENSE + * Version 3, 19 November 2007 + * Copyright (C) 2007 Free Software Foundation, Inc. + * Everyone is permitted to copy and distribute verbatim copies + * of this license document, but changing it is not allowed. + */ +namespace UVtools.WPF.Structures +{ + public sealed class BenchmarkTest + { + public const string DEVCPU = "Intel® Core™ i9-9900K @ 3.60 GHz"; + public const string DEVRAM = "G.SKILL Trident Z 32GB DDR4-3200MHz CL14"; + + public BenchmarkTest(string name, string functionName, float devSingleThreadResult = 0, float devMultiThreadResult = 0) + { + Name = name; + FunctionName = functionName; + DevSingleThreadResult = devSingleThreadResult; + DevMultiThreadResult = devMultiThreadResult; + } + + public string Name { get; } + public string FunctionName { get; } + + public float DevSingleThreadResult { get; } + public float DevMultiThreadResult { get; } + + public override string ToString() + { + return $"{Name}"; + } + } +} diff --git a/UVtools.WPF/UVtools.WPF.csproj b/UVtools.WPF/UVtools.WPF.csproj index 2575258..249e72b 100644 --- a/UVtools.WPF/UVtools.WPF.csproj +++ b/UVtools.WPF/UVtools.WPF.csproj @@ -24,10 +24,10 @@ 1701;1702; - + - - + + diff --git a/UVtools.WPF/Windows/BenchmarkWindow.axaml b/UVtools.WPF/Windows/BenchmarkWindow.axaml new file mode 100644 index 0000000..57b86ac --- /dev/null +++ b/UVtools.WPF/Windows/BenchmarkWindow.axaml @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +