diff --git a/src/ImageSharp/Memory/Allocators/UniformUnmanagedMemoryPoolMemoryAllocator.cs b/src/ImageSharp/Memory/Allocators/UniformUnmanagedMemoryPoolMemoryAllocator.cs index 6ea69c8926..8d8e8e3df8 100644 --- a/src/ImageSharp/Memory/Allocators/UniformUnmanagedMemoryPoolMemoryAllocator.cs +++ b/src/ImageSharp/Memory/Allocators/UniformUnmanagedMemoryPoolMemoryAllocator.cs @@ -13,6 +13,8 @@ namespace SixLabors.ImageSharp.Memory internal sealed class UniformUnmanagedMemoryPoolMemoryAllocator : MemoryAllocator { private const int OneMegabyte = 1 << 20; + + // 4 MB seemed to perform slightly better in benchmarks than 2MB or higher values: private const int DefaultContiguousPoolBlockSizeBytes = 4 * OneMegabyte; private const int DefaultNonPoolBlockSizeBytes = 32 * OneMegabyte; private readonly int sharedArrayPoolThresholdInBytes; diff --git a/tests/ImageSharp.Tests.ProfilingSandbox/LoadResizeSaveParallelMemoryStress.cs b/tests/ImageSharp.Tests.ProfilingSandbox/LoadResizeSaveParallelMemoryStress.cs index 487420318d..0c0691059a 100644 --- a/tests/ImageSharp.Tests.ProfilingSandbox/LoadResizeSaveParallelMemoryStress.cs +++ b/tests/ImageSharp.Tests.ProfilingSandbox/LoadResizeSaveParallelMemoryStress.cs @@ -99,7 +99,7 @@ namespace SixLabors.ImageSharp.Tests.ProfilingSandbox string fileName = ss[0]; string content = ss[1] .Replace("TotalSeconds", stats.TotalSeconds.ToString(CultureInfo.InvariantCulture)) - .Replace("EOL", Environment.NewLine, StringComparison.OrdinalIgnoreCase); + .Replace("EOL", Environment.NewLine); File.AppendAllText(fileName, content); } diff --git a/tests/ImageSharp.Tests/Image/LargeImageIntegrationTests.cs b/tests/ImageSharp.Tests/Image/LargeImageIntegrationTests.cs index f4d082b9b7..09ed2afa52 100644 --- a/tests/ImageSharp.Tests/Image/LargeImageIntegrationTests.cs +++ b/tests/ImageSharp.Tests/Image/LargeImageIntegrationTests.cs @@ -42,7 +42,6 @@ namespace SixLabors.ImageSharp.Tests [WithBasicTestPatternImages(width: 10, height: 10, PixelTypes.Rgba32)] public void TryGetSinglePixelSpan_WhenImageTooLarge_ReturnsFalse(TestImageProvider provider) { - provider.LimitAllocatorBufferCapacity().InPixels(10); using Image image = provider.GetImage(); Assert.False(image.TryGetSinglePixelSpan(out Span imageSpan));