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

automate finding vcvarsall to support more vs versions #95

Closed Bett-A-Fish closed 2 years ago

Bett-A-Fish commented 2 years ago

Fixes: #8

Description

replace hardcoded vswhere path with code to search for its location. based on code done in imaging.raw

github-actions[bot] commented 2 years ago

Benchmark Comparison - .NET Framework 4.8

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: 4, geomean: 1.175
total diff: 4

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_Write    |      1.25 |    2982269900.00 |    2378415200.00 |         |
| FileOnQ.Imaging.Heif.Benchmarks.PrimaryImage.PrimaryImage_ToArray  |      1.18 |    2743673900.00 |    2329252000.00 |         |
| FileOnQ.Imaging.Heif.Benchmarks.PrimaryImage.PrimaryImage_ToSpan   |      1.14 |    2829898300.00 |    2477386200.00 |         |
| FileOnQ.Imaging.Heif.Benchmarks.PrimaryImage.PrimaryImage_ToStream |      1.13 |    2766976750.00 |    2451573150.00 |         |

No file given

Benchmark Results - .NET Framework 4.8

thumbnail

``` ini BenchmarkDotNet=v0.13.1, OS=Windows 10.0.17763.2458 (1809/October2018Update/Redstone5), VM=Hyper-V Intel Xeon CPU E5-2673 v4 2.30GHz, 1 CPU, 2 logical and 2 physical cores [Host] : .NET Framework 4.8 (4.8.4470.0), X64 RyuJIT Job-GHSIOX : .NET Framework 4.8 (4.8.4470.0), X64 RyuJIT Runtime=.NET Framework 4.8 InvocationCount=1 LaunchCount=1 UnrollFactor=1 ``` | Method | Mean | Error | StdDev | Allocated native memory | Native memory leak | Allocated | |------------------- |---------:|---------:|---------:|------------------------:|-------------------:|----------:| | Thumbnail_Write | 58.74 ms | 0.975 ms | 0.865 ms | 5,123,891 B | - | 74,504 B | | Thumbnail_ToArray | 57.32 ms | 1.124 ms | 1.576 ms | 5,123,563 B | - | 74,504 B | | Thumbnail_ToSpan | 57.62 ms | 1.113 ms | 1.408 ms | 5,123,579 B | - | - | | Thumbnail_ToStream | 56.46 ms | 1.081 ms | 1.245 ms | 5,123,563 B | - | 140,816 B |

primary

``` ini BenchmarkDotNet=v0.13.1, OS=Windows 10.0.17763.2458 (1809/October2018Update/Redstone5), VM=Hyper-V Intel Xeon Platinum 8272CL CPU 2.60GHz, 1 CPU, 2 logical and 2 physical cores [Host] : .NET Framework 4.8 (4.8.4470.0), X64 RyuJIT Job-GHSIOX : .NET Framework 4.8 (4.8.4470.0), X64 RyuJIT Runtime=.NET Framework 4.8 InvocationCount=1 LaunchCount=1 UnrollFactor=1 ``` | Method | Mean | Error | StdDev | Median | Allocated native memory | Native memory leak | Allocated | |---------------------- |--------:|---------:|---------:|--------:|------------------------:|-------------------:|------------:| | PrimaryImage_Write | 2.330 s | 0.0458 s | 0.0790 s | 2.378 s | 222,029,214 B | - | 1,951,112 B | | PrimaryImage_ToArray | 2.326 s | 0.0459 s | 0.0754 s | 2.329 s | 222,028,886 B | - | 1,951,112 B | | PrimaryImage_ToSpan | 2.464 s | 0.0349 s | 0.0326 s | 2.477 s | 222,028,838 B | - | - | | PrimaryImage_ToStream | 2.441 s | 0.0451 s | 0.0443 s | 2.452 s | 222,028,774 B | - | 3,894,032 B |

Benchmark Comparison - .NET 5

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: 4, geomean: 1.295
total diff: 4

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_ToStream |      1.33 |    2982379850.00 |    2246547100.00 |         |
| FileOnQ.Imaging.Heif.Benchmarks.PrimaryImage.PrimaryImage_ToSpan   |      1.30 |    2976810300.00 |    2297760500.00 |         |
| FileOnQ.Imaging.Heif.Benchmarks.PrimaryImage.PrimaryImage_ToArray  |      1.29 |    2920373000.00 |    2270259100.00 |         |
| FileOnQ.Imaging.Heif.Benchmarks.PrimaryImage.PrimaryImage_Write    |      1.27 |    2905592400.00 |    2287904350.00 | several?|

No file given

Benchmark Results - .NET 5

thumbnail

``` ini BenchmarkDotNet=v0.13.1, OS=Windows 10.0.17763.2458 (1809/October2018Update/Redstone5) Intel Xeon Platinum 8171M CPU 2.60GHz, 1 CPU, 2 logical and 2 physical cores .NET SDK=6.0.101 [Host] : .NET 5.0.8 (5.0.821.31504), X64 RyuJIT Job-SVQTLY : .NET 5.0.8 (5.0.821.31504), X64 RyuJIT Runtime=.NET 5.0 InvocationCount=1 LaunchCount=1 UnrollFactor=1 ``` | Method | Mean | Error | StdDev | Allocated native memory | Native memory leak | Allocated | |------------------- |---------:|---------:|---------:|------------------------:|-------------------:|----------:| | Thumbnail_Write | 58.46 ms | 1.148 ms | 1.367 ms | 5,124,425 B | - | 288 B | | Thumbnail_ToArray | 56.97 ms | 1.113 ms | 1.524 ms | 5,123,853 B | - | 66,408 B | | Thumbnail_ToSpan | 57.40 ms | 1.065 ms | 0.996 ms | 5,123,853 B | - | 120 B | | Thumbnail_ToStream | 57.07 ms | 1.103 ms | 1.132 ms | 5,123,881 B | 12 B | 66,472 B |

primary

``` ini BenchmarkDotNet=v0.13.1, OS=Windows 10.0.17763.2458 (1809/October2018Update/Redstone5) Intel Xeon Platinum 8272CL CPU 2.60GHz, 1 CPU, 2 logical and 2 physical cores .NET SDK=6.0.101 [Host] : .NET 5.0.8 (5.0.821.31504), X64 RyuJIT Job-TXWZNQ : .NET 5.0.8 (5.0.821.31504), X64 RyuJIT Runtime=.NET 5.0 InvocationCount=1 LaunchCount=1 UnrollFactor=1 ``` | Method | Mean | Error | StdDev | Allocated native memory | Native memory leak | Allocated | |---------------------- |--------:|---------:|---------:|------------------------:|-------------------:|------------:| | PrimaryImage_Write | 2.300 s | 0.0451 s | 0.0911 s | 222,029,044 B | - | 256 B | | PrimaryImage_ToArray | 2.263 s | 0.0393 s | 0.0386 s | 222,028,744 B | - | 1,943,064 B | | PrimaryImage_ToSpan | 2.293 s | 0.0441 s | 0.0471 s | 222,028,648 B | - | 88 B | | PrimaryImage_ToStream | 2.258 s | 0.0375 s | 0.0432 s | 222,028,680 B | - | 1,943,072 B |

Benchmark Comparison - .NET 6

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

thumbnail

 summary:
worse: 4, geomean: 1.218
total diff: 4

| Slower                                                       | diff/base | Base Median (ns) | Diff Median (ns) | Modality|
| ------------------------------------------------------------ | ---------:| ----------------:| ----------------:| --------:|
| FileOnQ.Imaging.Heif.Benchmarks.Thumbnail.Thumbnail_Write    |      1.23 |      48024300.00 |      58928200.00 |         |
| FileOnQ.Imaging.Heif.Benchmarks.Thumbnail.Thumbnail_ToArray  |      1.22 |      47222300.00 |      57736800.00 |         |
| FileOnQ.Imaging.Heif.Benchmarks.Thumbnail.Thumbnail_ToSpan   |      1.22 |      47550100.00 |      57783900.00 |         |
| FileOnQ.Imaging.Heif.Benchmarks.Thumbnail.Thumbnail_ToStream |      1.21 |      47692700.00 |      57550600.00 |         |

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

No file given

primary

 summary:
better: 4, geomean: 1.209
total diff: 4

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_ToStream |      1.22 |    2979033400.00 |    2446766150.00 |         |
| FileOnQ.Imaging.Heif.Benchmarks.PrimaryImage.PrimaryImage_ToSpan   |      1.22 |    2975119200.00 |    2444263400.00 |         |
| FileOnQ.Imaging.Heif.Benchmarks.PrimaryImage.PrimaryImage_ToArray  |      1.21 |    2893204600.00 |    2398322200.00 |         |
| FileOnQ.Imaging.Heif.Benchmarks.PrimaryImage.PrimaryImage_Write    |      1.20 |    2872608900.00 |    2402306900.00 |         |

No file given

Benchmark Results - .NET 6

thumbnail

``` ini BenchmarkDotNet=v0.13.1, OS=Windows 10.0.17763.2458 (1809/October2018Update/Redstone5) Intel Xeon CPU E5-2673 v4 2.30GHz, 1 CPU, 2 logical and 2 physical cores .NET SDK=6.0.101 [Host] : .NET 6.0.1 (6.0.121.56705), X64 RyuJIT Job-OYHLEI : .NET 6.0.1 (6.0.121.56705), X64 RyuJIT Runtime=.NET 6.0 InvocationCount=1 LaunchCount=1 UnrollFactor=1 ``` | Method | Mean | Error | StdDev | Allocated native memory | Native memory leak | Allocated | |------------------- |---------:|---------:|---------:|------------------------:|-------------------:|----------:| | Thumbnail_Write | 59.60 ms | 1.179 ms | 1.614 ms | 5,124,409 B | - | 832 B | | Thumbnail_ToArray | 57.64 ms | 0.328 ms | 0.274 ms | 5,123,597 B | - | 66,888 B | | Thumbnail_ToSpan | 57.70 ms | 0.932 ms | 0.779 ms | 5,123,597 B | - | 600 B | | Thumbnail_ToStream | 57.65 ms | 0.591 ms | 0.493 ms | 5,124,109 B | 256 B | 66,952 B |

primary

``` ini BenchmarkDotNet=v0.13.1, OS=Windows 10.0.17763.2458 (1809/October2018Update/Redstone5) Intel Xeon Platinum 8272CL CPU 2.60GHz, 1 CPU, 2 logical and 2 physical cores .NET SDK=6.0.101 [Host] : .NET 6.0.1 (6.0.121.56705), X64 RyuJIT Job-MUISNM : .NET 6.0.1 (6.0.121.56705), X64 RyuJIT Runtime=.NET 6.0 InvocationCount=1 LaunchCount=1 UnrollFactor=1 ``` | Method | Mean | Error | StdDev | Allocated native memory | Native memory leak | Allocated | |---------------------- |--------:|---------:|---------:|------------------------:|-------------------:|------------:| | PrimaryImage_Write | 2.402 s | 0.0093 s | 0.0087 s | 222,029,236 B | - | 848 B | | PrimaryImage_ToArray | 2.399 s | 0.0043 s | 0.0040 s | 222,029,000 B | - | 1,943,536 B | | PrimaryImage_ToSpan | 2.445 s | 0.0021 s | 0.0018 s | 222,028,600 B | - | 616 B | | PrimaryImage_ToStream | 2.447 s | 0.0019 s | 0.0017 s | 222,028,648 B | - | 1,947,288 B |