SixLabors / ImageSharp

:camera: A modern, cross-platform, 2D Graphics library for .NET
https://sixlabors.com/products/imagesharp/
Other
7.31k stars 846 forks source link

Cleanup SimdUtils #2654

Closed JimBobSquarePants closed 6 months ago

JimBobSquarePants commented 6 months ago

Prerequisites

Description

The plan here is to be able to remove ExtendedIntrinsics and FallbackIntrinsics128 by normalizing the HwIntrinsics implementation adding Vector512 support and extending Vector128 support to include ARM.

Any and all input is welcome.

CC @tannergooding @saucecontrol @gfoidl @br3aker

JimBobSquarePants commented 6 months ago

Thanks for the review chaps. I've actioned the lot now. Will merge on successful build.

JimBobSquarePants commented 6 months ago

Stating to see some improvement in numbers here.

BenchmarkDotNet v0.13.11, Windows 11 (10.0.22631.3085/23H2/2023Update/SunValley3)
11th Gen Intel Core i7-11370H 3.30GHz, 1 CPU, 8 logical and 4 physical cores
.NET SDK 8.0.101
  [Host]   : .NET 8.0.1 (8.0.123.58001), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
  ShortRun : .NET 8.0.1 (8.0.123.58001), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI

Job=ShortRun  IterationCount=5  LaunchCount=1
WarmupCount=5
Method Mean Error StdDev Ratio Gen0 Gen1 Gen2 Allocated Alloc Ratio
'System.Drawing Load, Resize, Save' 368.56 ms 12.636 ms 1.955 ms 1.00 - - - 13.23 KB 1.00
'ImageFlow Load, Resize, Save' 270.28 ms 12.142 ms 3.153 ms 0.74 500.0000 500.0000 500.0000 4642.53 KB 351.00
'ImageSharp Load, Resize, Save' 114.87 ms 2.408 ms 0.625 ms 0.31 - - - 1314.02 KB 99.35
'ImageSharp TD Load, Resize, Save' 75.31 ms 1.923 ms 0.499 ms 0.20 166.6667 - - 1307.22 KB 98.83
'ImageMagick Load, Resize, Save' 393.97 ms 7.115 ms 1.101 ms 1.07 - - - 54.48 KB 4.12
'ImageFree Load, Resize, Save' 235.16 ms 2.376 ms 0.617 ms 0.64 6000.0000 6000.0000 6000.0000 95.8 KB 7.24
'MagicScaler Load, Resize, Save' 66.67 ms 0.873 ms 0.135 ms 0.18 - - - 45.42 KB 3.43
'SkiaSharp Load, Resize, Save' 136.42 ms 2.833 ms 0.736 ms 0.37 - - - 88.15 KB 6.66
'NetVips Load, Resize, Save' 122.52 ms 7.601 ms 1.974 ms 0.33 - - - 50.95 KB 3.85