diff --git a/tests/ImageSharp.Tests.ProfilingSandbox/Program.cs b/tests/ImageSharp.Tests.ProfilingSandbox/Program.cs index 7876c7dc60..9aa983ac5f 100644 --- a/tests/ImageSharp.Tests.ProfilingSandbox/Program.cs +++ b/tests/ImageSharp.Tests.ProfilingSandbox/Program.cs @@ -2,8 +2,6 @@ // Licensed under the Apache License, Version 2.0. using System; -using System.Diagnostics; -using System.IO; using SixLabors.ImageSharp.Tests.Formats.Jpg; using SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations; using SixLabors.ImageSharp.Tests.ProfilingBenchmarks; @@ -39,73 +37,7 @@ namespace SixLabors.ImageSharp.Tests.ProfilingSandbox // RunToVector4ProfilingTest(); // RunResizeProfilingTest(); - //Test_Performance(20); - - //Test_DebugRun("chroma_444_16x16", true); - //Console.WriteLine(); - //Test_DebugRun("chroma_420_16x16", true); - //Console.WriteLine(); - //Test_DebugRun("444_14x14"); - //Console.WriteLine(); - //Test_DebugRun("baseline_4k_444", false); - //Console.WriteLine(); - //Test_DebugRun("progressive_4k_444", true); - //Console.WriteLine(); - //Test_DebugRun("baseline_4k_420", false); - //Console.WriteLine(); - //Test_DebugRun("cmyk_jpeg"); - //Console.WriteLine(); - //Test_DebugRun("Channel_digital_image_CMYK_color"); - //Console.WriteLine(); - - //Test_DebugRun("test_baseline_4k_444", false); - //Console.WriteLine(); - //Test_DebugRun("test_progressive_4k_444", false); - //Console.WriteLine(); - //Test_DebugRun("test_baseline_4k_420", false); - //Console.WriteLine(); - - // Binary size of this must be ~2096kb - //Test_DebugRun("422", true); - - //Test_DebugRun("baseline_4k_420", false); - //Test_DebugRun("baseline_s444_q100", false); - //Test_DebugRun("progressive_s420_q100", false); - //Test_DebugRun("baseline_4k_420", true); - Test_DebugRun("baseline_s444_q100", true); - //Test_DebugRun("progressive_s420_q100", true); - - //Console.ReadLine(); - } - - public static void Test_Performance(int iterations) - { - using var stream = new MemoryStream(File.ReadAllBytes("C:\\Users\\pl4nu\\Downloads\\progressive_4k_444.jpg")); - //using var stream = new MemoryStream(File.ReadAllBytes("C:\\Users\\pl4nu\\Downloads\\baseline_4k_444.jpg")); - var sw = new Stopwatch(); - sw.Start(); - for (int i = 0; i < iterations; i++) - { - using var img = Image.Load(stream); - stream.Position = 0; - } - - sw.Stop(); - Console.WriteLine($"Elapsed: {sw.ElapsedMilliseconds}ms\nPer invocation: {sw.ElapsedMilliseconds / iterations}ms"); - } - - public static void Test_DebugRun(string name, bool save = false) - { - Console.ForegroundColor = ConsoleColor.Red; - Console.WriteLine($"img: {name}"); - Console.ResetColor(); - using var img = Image.Load($"C:\\Users\\pl4nu\\Downloads\\{name}.jpg"); - - if (save) - { - img.SaveAsJpeg($"C:\\Users\\pl4nu\\Downloads\\test_{name}.jpg", - new ImageSharp.Formats.Jpeg.JpegEncoder { Subsample = ImageSharp.Formats.Jpeg.JpegSubsample.Ratio444, Quality = 100 }); - } + Console.ReadLine(); } private static void RunJpegEncoderProfilingTests()