FileOnQ / Imaging.Heif

A C#/.NET wrapper around libheif for decoding and processing high efficiency image formats (heif, heic).
GNU Lesser General Public License v3.0
15 stars 4 forks source link

Removing explicit x86 and x64 classes and going to a "Native" wrapper. #36

Closed kenny-sellers closed 2 years ago

kenny-sellers commented 2 years ago

Description

Removing explicit X86 and x64 classes to clean up code. resolves #35

Merge Checklist

github-actions[bot] commented 2 years ago

Benchmark Comparison

Benchmarking comparison between this Pull Request and the comitted values at benchmarks/results

thumbnail

 No differences found between the benchmark results with threshold 10%.

primary

 summary:
better: 3, geomean: 1.224
total diff: 3

No Slower results for the provided threshold = 10% and noise filter = 0.3ns.

| Faster                                                             | base/diff | Base Median (ns) | Diff Median (ns) | Modality|
| ------------------------------------------------------------------ | ---------:| ----------------:| ----------------:| --------:|
| FileOnQ.Imaging.Heif.Benchmarks.PrimaryImage.PrimaryImage_ToArray  |      1.24 |    2880173350.00 |    2318961250.00 |         |
| FileOnQ.Imaging.Heif.Benchmarks.PrimaryImage.PrimaryImage_ToSpan   |      1.22 |    2770930800.00 |    2272288200.00 |         |
| FileOnQ.Imaging.Heif.Benchmarks.PrimaryImage.PrimaryImage_ToStream |      1.21 |    2719733500.00 |    2245484100.00 |         |

No file given

Benchmark Results

thumbnail

``` ini BenchmarkDotNet=v0.13.0, OS=Windows 10.0.17763.2183 (1809/October2018Update/Redstone5) Intel Xeon Platinum 8272CL CPU 2.60GHz, 1 CPU, 2 logical and 2 physical cores .NET SDK=5.0.401 [Host] : .NET 5.0.10 (5.0.1021.41214), X64 RyuJIT Job-QGQZLJ : .NET 5.0.10 (5.0.1021.41214), X64 RyuJIT Runtime=.NET 5.0 InvocationCount=1 LaunchCount=1 UnrollFactor=1 ``` | Method | Mean | Error | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated | Allocated native memory | Native memory leak | |------------------- |---------:|---------:|---------:|------:|------:|------:|----------:|------------------------:|-------------------:| | Thumbnail_Write | 50.19 ms | 0.543 ms | 0.454 ms | - | - | - | 288 B | 5,124,881 B | - | | Thumbnail_ToArray | 49.11 ms | 0.115 ms | 0.102 ms | - | - | - | 66,408 B | 5,124,661 B | 48 B | | Thumbnail_ToSpan | 49.03 ms | 0.222 ms | 0.173 ms | - | - | - | 120 B | 5,124,613 B | - | | Thumbnail_ToStream | 49.31 ms | 0.323 ms | 0.302 ms | - | - | - | 66,472 B | 5,124,325 B | - |

primary

``` ini BenchmarkDotNet=v0.13.0, OS=Windows 10.0.17763.2183 (1809/October2018Update/Redstone5) Intel Xeon CPU E5-2673 v4 2.30GHz, 1 CPU, 2 logical and 2 physical cores .NET SDK=5.0.401 [Host] : .NET 5.0.10 (5.0.1021.41214), X64 RyuJIT Job-LXBTEU : .NET 5.0.10 (5.0.1021.41214), X64 RyuJIT Runtime=.NET 5.0 InvocationCount=1 LaunchCount=1 UnrollFactor=1 ``` | Method | Mean | Error | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated | Allocated native memory | Native memory leak | |---------------------- |--------:|---------:|---------:|------:|------:|------:|------------:|------------------------:|-------------------:| | PrimaryImage_Write | 2.728 s | 0.0234 s | 0.0208 s | - | - | - | 256 B | 222,029,948 B | - | | PrimaryImage_ToArray | 2.336 s | 0.0455 s | 0.0524 s | - | - | - | 1,943,008 B | 222,029,088 B | - | | PrimaryImage_ToSpan | 2.279 s | 0.0199 s | 0.0177 s | - | - | - | 88 B | 222,029,424 B | - | | PrimaryImage_ToStream | 2.247 s | 0.0209 s | 0.0175 s | - | - | - | 1,943,072 B | 222,029,376 B | - |