Skip to content

Commit

Permalink
Update the NetVips benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
kleisauke committed Nov 18, 2023
1 parent 431e539 commit b0f1a1d
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ keep entire images in memory, it's light. For example, the `NetVips` benchmark:
[NetVips.Benchmarks](https://github.com/kleisauke/net-vips/tree/master/tests/NetVips.Benchmarks)

Loads a large image, shrinks by 10%, sharpens, and saves again. On this test
`NetVips` is around 23 times faster than Magick.NET and 3 times faster than ImageSharp.
`NetVips` is around 20 times faster than Magick.NET and 3 times faster than ImageSharp.

The [libvips documentation](https://libvips.github.io/libvips/API/current)
has a [chapter explaining how libvips opens
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ _disableFooter: true
<section>
<h2>Runs quickly and uses little memory</h2>
<p class="lead">NetVips is fast and needs little memory. The <a href="https://github.com/kleisauke/net-vips/tree/master/tests/NetVips.Benchmarks">NetVips.Benchmarks</a> project tests NetVips against Magick.NET and ImageSharp.
NetVips is around 23 times faster than Magick.NET and 3 times faster than ImageSharp.</p>
NetVips is around 20 times faster than Magick.NET and 3 times faster than ImageSharp.</p>
</section>
</div>
</div>
Expand Down
12 changes: 6 additions & 6 deletions tests/NetVips.Benchmarks/NetVips.Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.5" />
<PackageReference Include="Magick.NET-Q8-AnyCPU" Version="13.0.0" />
<PackageReference Include="NetVips.Native" Version="8.14.2" Condition="'$(UseGlobalLibvips)' == 'false'" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.0.0" />
<PackageReference Include="SkiaSharp" Version="2.88.3" />
<PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="2.88.3" Condition="$([MSBuild]::IsOSPlatform('Linux'))" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.10" />
<PackageReference Include="Magick.NET-Q8-AnyCPU" Version="13.4.0" />
<PackageReference Include="NetVips.Native" Version="8.15.0" Condition="'$(UseGlobalLibvips)' == 'false'" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.0.2" />
<PackageReference Include="SkiaSharp" Version="2.88.6" />
<PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="2.88.6" Condition="$([MSBuild]::IsOSPlatform('Linux'))" />
<PackageReference Include="System.Drawing.Common" Version="8.0.0" Condition="$([MSBuild]::IsOSPlatform('Windows'))" />
</ItemGroup>

Expand Down
40 changes: 20 additions & 20 deletions tests/NetVips.Benchmarks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,31 @@ of VIPS library.

## Benchmarks

Run on 24/03/23 with libvips 8.14.2, Magick.NET 13.0.0, ImageSharp 3.0.0, SkiaSharp 2.88.3 and System.Drawing.Common 7.0.0.
Run on 18/11/23 with libvips 8.15.0, Magick.NET 13.4.0, ImageSharp 3.0.2, SkiaSharp 2.88.6 and System.Drawing.Common 8.0.0.

``` ini
```
BenchmarkDotNet=v0.13.5, OS=Windows 11 (10.0.22621.1413/22H2/2022Update/SunValley2)
Intel Core i5-8600K CPU 3.60GHz (Coffee Lake), 1 CPU, 6 logical and 6 physical cores
.NET SDK=7.0.202
[Host] : .NET 7.0.4 (7.0.423.11508), X64 RyuJIT AVX2
.NET 7.0 CLI (NativeAOT) : .NET 7.0.4 (7.0.423.11508), X64 RyuJIT AVX2
BenchmarkDotNet v0.13.10, Windows 11 (10.0.22631.2715/23H2/2023Update/SunValley3)
AMD Ryzen 9 7900, 1 CPU, 24 logical and 12 physical cores
.NET SDK 8.0.100
[Host] : .NET 8.0.0 (8.0.23.53103), X64 RyuJIT AVX2
.NET 8.0 CLI (NativeAOT) : .NET 8.0.0 (8.0.23.53103), X64 RyuJIT AVX2
Job=.NET 7.0 CLI (NativeAOT) Runtime=NativeAOT 7.0 Toolchain=.NET 7.0
Job=.NET 8.0 CLI (NativeAOT) Runtime=NativeAOT 8.0 Toolchain=.NET 8.0
```
| Method | input | output | Mean | Error | StdDev | Ratio | RatioSD |
|--------------------------- |------ |------- |-----------:|--------:|--------:|------:|--------:|
| **NetVips** | **t.jpg** | **t2.jpg** | **175.8 ms** | **1.33 ms** | **1.18 ms** | **1.00** | **0.00** |
| Magick.NET | t.jpg | t2.jpg | 3,582.5 ms | 5.45 ms | 4.83 ms | 20.38 | 0.15 |
| ImageSharp | t.jpg | t2.jpg | 508.3 ms | 2.54 ms | 2.25 ms | 2.89 | 0.02 |
| SkiaSharp<sup>1</sup> | t.jpg | t2.jpg | 1,991.4 ms | 7.27 ms | 6.07 ms | 11.34 | 0.06 |
| System.Drawing<sup>2</sup> | t.jpg | t2.jpg | 2,407.3 ms | 5.26 ms | 4.66 ms | 13.69 | 0.09 |
| | | | | | | | |
| **NetVips** | **t.tif** | **t2.tif** | **131.7 ms** | **0.96 ms** | **0.80 ms** | **1.00** | **0.00** |
| Magick.NET | t.tif | t2.tif | 3,443.5 ms | 5.82 ms | 5.44 ms | 26.14 | 0.18 |
| ImageSharp | t.tif | t2.tif | 382.6 ms | 5.25 ms | 4.91 ms | 2.90 | 0.04 |
| System.Drawing<sup>2</sup> | t.tif | t2.tif | 2,063.0 ms | 4.03 ms | 3.77 ms | 15.66 | 0.09 |
| Method | input | output | Mean | Error | StdDev | Ratio | RatioSD |
|--------------------------- |------ |------- |------------:|---------:|---------:|------:|--------:|
| **NetVips** | **t.jpg** | **t2.jpg** | **105.43 ms** | **2.054 ms** | **2.522 ms** | **1.00** | **0.00** |
| Magick.NET | t.jpg | t2.jpg | 1,741.20 ms | 6.126 ms | 5.116 ms | 16.44 | 0.46 |
| ImageSharp | t.jpg | t2.jpg | 336.34 ms | 4.142 ms | 3.672 ms | 3.17 | 0.08 |
| SkiaSharp<sup>1</sup> | t.jpg | t2.jpg | 895.18 ms | 5.438 ms | 4.541 ms | 8.45 | 0.24 |
| System.Drawing<sup>2</sup> | t.jpg | t2.jpg | 1,435.57 ms | 2.944 ms | 2.754 ms | 13.55 | 0.37 |
| | | | | | | | |
| **NetVips** | **t.tif** | **t2.tif** | **65.26 ms** | **1.258 ms** | **1.235 ms** | **1.00** | **0.00** |
| Magick.NET | t.tif | t2.tif | 1,647.24 ms | 4.682 ms | 4.380 ms | 25.27 | 0.49 |
| ImageSharp | t.tif | t2.tif | 250.84 ms | 2.152 ms | 2.013 ms | 3.85 | 0.07 |
| System.Drawing<sup>2</sup> | t.tif | t2.tif | 1,212.72 ms | 4.588 ms | 4.292 ms | 18.61 | 0.36 |

<sup>1</sup> SkiaSharp does not have TIFF support, so I only tested with JPEG files.
<sup>2</sup> System.Drawing does not have a sharpening or convolution operation, so I skipped that part of the benchmark.
Expand Down

0 comments on commit b0f1a1d

Please sign in to comment.