diff --git a/tests/ImageSharp.Tests.ProfilingSandbox/LoadResizeSaveParallelMemoryStress.cs b/tests/ImageSharp.Tests.ProfilingSandbox/LoadResizeSaveParallelMemoryStress.cs index acec87ca5..734bbf826 100644 --- a/tests/ImageSharp.Tests.ProfilingSandbox/LoadResizeSaveParallelMemoryStress.cs +++ b/tests/ImageSharp.Tests.ProfilingSandbox/LoadResizeSaveParallelMemoryStress.cs @@ -52,7 +52,12 @@ namespace SixLabors.ImageSharp.Tests.ProfilingSandbox { Console.WriteLine("Running ImageSharp with options:"); Console.WriteLine(options.ToString()); - Configuration.Default.MemoryAllocator = options.CreateMemoryAllocator(); + + if (!options.KeepDefaultAllocator) + { + MemoryAllocator.Default = Configuration.Default.MemoryAllocator = options.CreateMemoryAllocator(); + } + timer = Stopwatch.StartNew(); try { @@ -197,6 +202,9 @@ namespace SixLabors.ImageSharp.Tests.ProfilingSandbox [Option('i', "imagesharp", Required = false, Default = false, HelpText = "Test ImageSharp without benchmark switching")] public bool ImageSharp { get; set; } + [Option('d', "default-allocator", Required = false, Default = false, HelpText = "Keep default MemoryAllocator and ignore all settings")] + public bool KeepDefaultAllocator { get; set; } + [Option('m', "max-contiguous", Required = false, Default = 4, HelpText = "Maximum size of contiguous pool buffers in MegaBytes")] public int MaxContiguousPoolBufferMegaBytes { get; set; } = 4; @@ -244,7 +252,7 @@ namespace SixLabors.ImageSharp.Tests.ProfilingSandbox } public override string ToString() => - $"p({this.MaxDegreeOfParallelism})_i({this.ImageSharp})_m({this.MaxContiguousPoolBufferMegaBytes})_s({this.MaxPoolSizeMegaBytes})_u({this.MaxCapacityOfNonPoolBuffersMegaBytes})_r({this.RepeatCount})_g({this.FinalGcCount})_e({this.ReleaseRetainedResourcesAtEnd})"; + $"p({this.MaxDegreeOfParallelism})_i({this.ImageSharp})_d({this.KeepDefaultAllocator})_m({this.MaxContiguousPoolBufferMegaBytes})_s({this.MaxPoolSizeMegaBytes})_u({this.MaxCapacityOfNonPoolBuffersMegaBytes})_r({this.RepeatCount})_g({this.FinalGcCount})_e({this.ReleaseRetainedResourcesAtEnd})"; public MemoryAllocator CreateMemoryAllocator() { diff --git a/tests/ImageSharp.Tests.ProfilingSandbox/Program.cs b/tests/ImageSharp.Tests.ProfilingSandbox/Program.cs index 2e0d8d97c..bbdb73ffb 100644 --- a/tests/ImageSharp.Tests.ProfilingSandbox/Program.cs +++ b/tests/ImageSharp.Tests.ProfilingSandbox/Program.cs @@ -36,7 +36,6 @@ namespace SixLabors.ImageSharp.Tests.ProfilingSandbox { try { - Console.WriteLine("WUT: " + GetNetCoreVersion()); LoadResizeSaveParallelMemoryStress.Run(args); } catch (Exception ex)