mirror of
https://github.com/Cykooz/fast_image_resize.git
synced 2026-10-08 01:11:09 +00:00
Added results of ARM64 benchmarks.
This commit is contained in:
@@ -95,6 +95,7 @@ opt-level = 3
|
||||
|
||||
[profile.release]
|
||||
opt-level = 3
|
||||
#incremental = true
|
||||
#lto = true
|
||||
#codegen-units = 1
|
||||
#strip = true
|
||||
|
||||
@@ -43,7 +43,8 @@ that converts images from sRGB or gamma 2.2 into linear colorspace and back.
|
||||
|
||||
## Some benchmarks
|
||||
|
||||
[All benchmarks.](https://github.com/Cykooz/fast_image_resize/blob/main/benchmarks.md)
|
||||
- [All x86-64 benchmarks.](https://github.com/Cykooz/fast_image_resize/blob/main/benchmarks_x86-64.md)
|
||||
- [All arm64 benchmarks.](https://github.com/Cykooz/fast_image_resize/blob/main/benchmarks_arm64.md)
|
||||
|
||||
Rust libraries used to compare of resizing speed:
|
||||
|
||||
@@ -177,7 +178,6 @@ fn main() {
|
||||
### Resize with cropping
|
||||
|
||||
```rust
|
||||
use std::io::BufWriter;
|
||||
use std::num::NonZeroU32;
|
||||
|
||||
use image::codecs::png::PngEncoder;
|
||||
|
||||
@@ -0,0 +1,158 @@
|
||||
## Benchmarks of fast_image_resize crate
|
||||
|
||||
Environment:
|
||||
|
||||
- CPU: Neoverse-N1 2GHz (Oracle Cloud Compute, VM.Standard.A1.Flex)
|
||||
- Ubuntu 22.04 (linux 5.15.0)
|
||||
- Rust 1.65
|
||||
- fast_image_resize = "2.3.0"
|
||||
- glassbench = "0.3.3"
|
||||
|
||||
Other Rust libraries used to compare of resizing speed:
|
||||
|
||||
- image = "0.24.5" (<https://crates.io/crates/image>)
|
||||
- resize = "0.7.4" (<https://crates.io/crates/resize>)
|
||||
|
||||
Resize algorithms:
|
||||
|
||||
- Nearest
|
||||
- Convolution with Bilinear filter
|
||||
- Convolution with CatmullRom filter
|
||||
- Convolution with Lanczos3 filter
|
||||
|
||||
### Resize RGB8 image (U8x3) 4928x3279 => 852x567
|
||||
|
||||
Pipeline:
|
||||
|
||||
`src_image => resize => dst_image`
|
||||
|
||||
- Source image [nasa-4928x3279.png](https://github.com/Cykooz/fast_image_resize/blob/main/data/nasa-4928x3279.png)
|
||||
- Numbers in table is mean duration of image resizing in milliseconds.
|
||||
|
||||
| | Nearest | Bilinear | CatmullRom | Lanczos3 |
|
||||
|----------|:-------:|:--------:|:----------:|:--------:|
|
||||
| image | 85.93 | 171.20 | 320.80 | 449.38 |
|
||||
| resize | - | 89.59 | 178.16 | 264.02 |
|
||||
| fir rust | 0.89 | 71.61 | 87.07 | 113.22 |
|
||||
| fir neon | 0.89 | 42.71 | 57.18 | 81.30 |
|
||||
|
||||
### Resize RGBA8 image (U8x4) 4928x3279 => 852x567
|
||||
|
||||
Pipeline:
|
||||
|
||||
`src_image => multiply by alpha => resize => divide by alpha => dst_image`
|
||||
|
||||
- Source image
|
||||
[nasa-4928x3279-rgba.png](https://github.com/Cykooz/fast_image_resize/blob/main/data/nasa-4928x3279-rgba.png)
|
||||
- Numbers in table is mean duration of image resizing in milliseconds.
|
||||
- The `image` crate does not support multiplying and dividing by alpha channel.
|
||||
|
||||
| | Nearest | Bilinear | CatmullRom | Lanczos3 |
|
||||
|----------|:-------:|:--------:|:----------:|:--------:|
|
||||
| resize | - | 99.10 | 181.34 | 276.12 |
|
||||
| fir rust | 0.97 | 92.78 | 105.04 | 153.77 |
|
||||
| fir neon | 0.97 | 44.90 | 62.46 | 84.09 |
|
||||
|
||||
### Resize L8 image (U8) 4928x3279 => 852x567
|
||||
|
||||
Pipeline:
|
||||
|
||||
`src_image => resize => dst_image`
|
||||
|
||||
- Source image [nasa-4928x3279.png](https://github.com/Cykooz/fast_image_resize/blob/main/data/nasa-4928x3279.png)
|
||||
has converted into grayscale image with one byte per pixel.
|
||||
- Numbers in table is mean duration of image resizing in milliseconds.
|
||||
|
||||
| | Nearest | Bilinear | CatmullRom | Lanczos3 |
|
||||
|----------|:-------:|:--------:|:----------:|:--------:|
|
||||
| image | 78.06 | 106.41 | 176.68 | 245.22 |
|
||||
| resize | - | 36.88 | 83.23 | 127.15 |
|
||||
| fir rust | 0.50 | 29.88 | 37.78 | 45.48 |
|
||||
| fir neon | 0.50 | 15.00 | 20.18 | 28.12 |
|
||||
|
||||
### Resize LA8 image (U8x2) 4928x3279 => 852x567
|
||||
|
||||
Pipeline:
|
||||
|
||||
`src_image => multiply by alpha => resize => divide by alpha => dst_image`
|
||||
|
||||
- Source image
|
||||
[nasa-4928x3279-rgba.png](https://github.com/Cykooz/fast_image_resize/blob/main/data/nasa-4928x3279-rgba.png)
|
||||
has converted into grayscale image with alpha channel (two bytes per pixel).
|
||||
- Numbers in table is mean duration of image resizing in milliseconds.
|
||||
- The `image` crate does not support multiplying and dividing by alpha channel.
|
||||
- The `resize` crate does not support this pixel format.
|
||||
|
||||
| | Nearest | Bilinear | CatmullRom | Lanczos3 |
|
||||
|----------|:-------:|:--------:|:----------:|:--------:|
|
||||
| fir rust | 0.68 | 59.66 | 74.65 | 73.06 |
|
||||
| fir neon | 0.68 | 34.60 | 39.08 | 54.73 |
|
||||
|
||||
### Resize RGB16 image (U16x3) 4928x3279 => 852x567
|
||||
|
||||
Pipeline:
|
||||
|
||||
`src_image => resize => dst_image`
|
||||
|
||||
- Source image [nasa-4928x3279.png](https://github.com/Cykooz/fast_image_resize/blob/main/data/nasa-4928x3279.png)
|
||||
has converted into RGB16 image.
|
||||
- Numbers in table is mean duration of image resizing in milliseconds.
|
||||
|
||||
| | Nearest | Bilinear | CatmullRom | Lanczos3 |
|
||||
|----------|:-------:|:--------:|:----------:|:--------:|
|
||||
| image | 89.19 | 166.71 | 327.39 | 467.86 |
|
||||
| resize | - | 90.71 | 181.91 | 268.88 |
|
||||
| fir rust | 1.36 | 146.82 | 275.19 | 392.50 |
|
||||
| fir neon | 1.36 | 69.87 | 91.79 | 128.15 |
|
||||
|
||||
### Resize RGBA16 image (U16x4) 4928x3279 => 852x567
|
||||
|
||||
Pipeline:
|
||||
|
||||
`src_image => multiply by alpha => resize => divide by alpha => dst_image`
|
||||
|
||||
- Source image
|
||||
[nasa-4928x3279-rgba.png](https://github.com/Cykooz/fast_image_resize/blob/main/data/nasa-4928x3279-rgba.png)
|
||||
- Numbers in table is mean duration of image resizing in milliseconds.
|
||||
- The `image` crate does not support multiplying and dividing by alpha channel.
|
||||
|
||||
| | Nearest | Bilinear | CatmullRom | Lanczos3 |
|
||||
|----------|:-------:|:--------:|:----------:|:--------:|
|
||||
| resize | - | 102.51 | 185.43 | 281.28 |
|
||||
| fir rust | 1.50 | 214.69 | 378.24 | 533.35 |
|
||||
| fir neon | 1.50 | 89.46 | 128.85 | 170.34 |
|
||||
|
||||
### Resize L16 image (U16) 4928x3279 => 852x567
|
||||
|
||||
Pipeline:
|
||||
|
||||
`src_image => resize => dst_image`
|
||||
|
||||
- Source image [nasa-4928x3279.png](https://github.com/Cykooz/fast_image_resize/blob/main/data/nasa-4928x3279.png)
|
||||
has converted into grayscale image with two bytes per pixel.
|
||||
- Numbers in table is mean duration of image resizing in milliseconds.
|
||||
|
||||
| | Nearest | Bilinear | CatmullRom | Lanczos3 |
|
||||
|----------|:-------:|:--------:|:----------:|:--------:|
|
||||
| image | 77.31 | 110.40 | 185.91 | 257.17 |
|
||||
| resize | - | 40.43 | 63.70 | 87.11 |
|
||||
| fir rust | 0.62 | 57.29 | 95.09 | 134.81 |
|
||||
| fir neon | 0.62 | 17.37 | 26.63 | 37.92 |
|
||||
|
||||
### Resize LA16 (luma with alpha channel) image (U16x2) 4928x3279 => 852x567
|
||||
|
||||
Pipeline:
|
||||
|
||||
`src_image => multiply by alpha => resize => divide by alpha => dst_image`
|
||||
|
||||
- Source image
|
||||
[nasa-4928x3279-rgba.png](https://github.com/Cykooz/fast_image_resize/blob/main/data/nasa-4928x3279-rgba.png)
|
||||
has converted into grayscale image with alpha channel (four bytes per pixel).
|
||||
- Numbers in table is mean duration of image resizing in milliseconds.
|
||||
- The `image` crate does not support multiplying and dividing by alpha channel.
|
||||
- The `resize` crate does not support this pixel format.
|
||||
|
||||
| | Nearest | Bilinear | CatmullRom | Lanczos3 |
|
||||
|----------|:-------:|:--------:|:----------:|:--------:|
|
||||
| fir rust | 0.95 | 106.75 | 192.09 | 270.97 |
|
||||
| fir neon | 0.95 | 35.61 | 53.87 | 73.33 |
|
||||
@@ -6,12 +6,12 @@ Environment:
|
||||
- RAM: DDR4 3800 MHz
|
||||
- Ubuntu 22.04 (linux 5.15.0)
|
||||
- Rust 1.65
|
||||
- fast_image_resize = "2.1.0"
|
||||
- fast_image_resize = "2.3.0"
|
||||
- glassbench = "0.3.3"
|
||||
|
||||
Other Rust libraries used to compare of resizing speed:
|
||||
|
||||
- image = "0.24.4" (<https://crates.io/crates/image>)
|
||||
- image = "0.24.5" (<https://crates.io/crates/image>)
|
||||
- resize = "0.7.4" (<https://crates.io/crates/resize>)
|
||||
|
||||
Resize algorithms:
|
||||
@@ -32,11 +32,11 @@ Pipeline:
|
||||
|
||||
| | Nearest | Bilinear | CatmullRom | Lanczos3 |
|
||||
|------------|:-------:|:--------:|:----------:|:--------:|
|
||||
| image | 21.19 | 83.63 | 143.36 | 204.99 |
|
||||
| resize | - | 45.90 | 90.65 | 134.75 |
|
||||
| fir rust | 0.28 | 38.73 | 75.43 | 111.71 |
|
||||
| fir sse4.1 | 0.28 | 9.35 | 13.63 | 19.20 |
|
||||
| fir avx2 | 0.28 | 7.36 | 9.52 | 13.66 |
|
||||
| image | 21.19 | 83.67 | 142.85 | 200.63 |
|
||||
| resize | - | 48.86 | 97.63 | 145.82 |
|
||||
| fir rust | 0.28 | 38.49 | 75.80 | 106.99 |
|
||||
| fir sse4.1 | 0.28 | 9.45 | 13.59 | 19.39 |
|
||||
| fir avx2 | 0.28 | 7.53 | 9.61 | 13.78 |
|
||||
|
||||
### Resize RGBA8 image (U8x4) 4928x3279 => 852x567
|
||||
|
||||
@@ -51,10 +51,10 @@ Pipeline:
|
||||
|
||||
| | Nearest | Bilinear | CatmullRom | Lanczos3 |
|
||||
|------------|:-------:|:--------:|:----------:|:--------:|
|
||||
| resize | - | 65.62 | 129.84 | 193.56 |
|
||||
| fir rust | 0.19 | 37.38 | 53.83 | 76.69 |
|
||||
| fir sse4.1 | 0.19 | 13.02 | 17.18 | 22.33 |
|
||||
| fir avx2 | 0.19 | 9.56 | 12.04 | 16.27 |
|
||||
| resize | - | 65.57 | 129.76 | 193.57 |
|
||||
| fir rust | 0.18 | 37.33 | 53.84 | 76.67 |
|
||||
| fir sse4.1 | 0.18 | 13.01 | 17.21 | 22.41 |
|
||||
| fir avx2 | 0.18 | 9.58 | 12.03 | 16.28 |
|
||||
|
||||
### Resize L8 image (U8) 4928x3279 => 852x567
|
||||
|
||||
@@ -68,11 +68,11 @@ Pipeline:
|
||||
|
||||
| | Nearest | Bilinear | CatmullRom | Lanczos3 |
|
||||
|------------|:-------:|:--------:|:----------:|:--------:|
|
||||
| image | 17.56 | 49.20 | 77.55 | 106.07 |
|
||||
| resize | - | 17.71 | 36.82 | 62.15 |
|
||||
| fir rust | 0.15 | 13.36 | 14.81 | 22.22 |
|
||||
| fir sse4.1 | 0.15 | 4.51 | 5.08 | 7.61 |
|
||||
| fir avx2 | 0.15 | 6.00 | 4.77 | 7.46 |
|
||||
| image | 17.79 | 49.78 | 78.10 | 106.32 |
|
||||
| resize | - | 17.11 | 35.43 | 60.81 |
|
||||
| fir rust | 0.15 | 13.48 | 15.50 | 23.58 |
|
||||
| fir sse4.1 | 0.15 | 4.53 | 5.08 | 7.61 |
|
||||
| fir avx2 | 0.15 | 6.00 | 4.75 | 7.46 |
|
||||
|
||||
### Resize LA8 image (U8x2) 4928x3279 => 852x567
|
||||
|
||||
@@ -89,9 +89,9 @@ Pipeline:
|
||||
|
||||
| | Nearest | Bilinear | CatmullRom | Lanczos3 |
|
||||
|------------|:-------:|:--------:|:----------:|:--------:|
|
||||
| fir rust | 0.17 | 25.72 | 30.48 | 42.69 |
|
||||
| fir sse4.1 | 0.17 | 12.44 | 14.26 | 17.69 |
|
||||
| fir avx2 | 0.17 | 8.40 | 9.53 | 12.09 |
|
||||
| fir rust | 0.17 | 25.72 | 30.47 | 42.66 |
|
||||
| fir sse4.1 | 0.17 | 12.46 | 14.29 | 17.68 |
|
||||
| fir avx2 | 0.17 | 8.40 | 9.54 | 12.11 |
|
||||
|
||||
### Resize RGB16 image (U16x3) 4928x3279 => 852x567
|
||||
|
||||
@@ -105,11 +105,11 @@ Pipeline:
|
||||
|
||||
| | Nearest | Bilinear | CatmullRom | Lanczos3 |
|
||||
|------------|:-------:|:--------:|:----------:|:--------:|
|
||||
| image | 21.20 | 76.55 | 129.51 | 180.79 |
|
||||
| resize | - | 45.34 | 89.33 | 132.50 |
|
||||
| fir rust | 0.33 | 43.41 | 80.01 | 114.53 |
|
||||
| fir sse4.1 | 0.33 | 24.01 | 39.11 | 55.22 |
|
||||
| fir avx2 | 0.33 | 19.32 | 29.30 | 35.98 |
|
||||
| image | 21.41 | 77.21 | 129.91 | 180.91 |
|
||||
| resize | - | 45.29 | 89.53 | 133.11 |
|
||||
| fir rust | 0.33 | 44.13 | 79.81 | 114.73 |
|
||||
| fir sse4.1 | 0.33 | 23.98 | 39.08 | 55.20 |
|
||||
| fir avx2 | 0.33 | 19.41 | 29.18 | 36.06 |
|
||||
|
||||
### Resize RGBA16 image (U16x4) 4928x3279 => 852x567
|
||||
|
||||
@@ -124,10 +124,10 @@ Pipeline:
|
||||
|
||||
| | Nearest | Bilinear | CatmullRom | Lanczos3 |
|
||||
|------------|:-------:|:--------:|:----------:|:--------:|
|
||||
| resize | - | 63.72 | 126.13 | 188.03 |
|
||||
| fir rust | 0.36 | 83.15 | 120.73 | 160.78 |
|
||||
| fir sse4.1 | 0.36 | 42.33 | 63.74 | 85.79 |
|
||||
| fir avx2 | 0.36 | 23.74 | 34.94 | 46.48 |
|
||||
| resize | - | 63.77 | 125.95 | 187.88 |
|
||||
| fir rust | 0.37 | 82.06 | 120.76 | 160.84 |
|
||||
| fir sse4.1 | 0.37 | 42.40 | 63.79 | 85.78 |
|
||||
| fir avx2 | 0.37 | 23.90 | 35.07 | 46.52 |
|
||||
|
||||
### Resize L16 image (U16) 4928x3279 => 852x567
|
||||
|
||||
@@ -141,11 +141,11 @@ Pipeline:
|
||||
|
||||
| | Nearest | Bilinear | CatmullRom | Lanczos3 |
|
||||
|------------|:-------:|:--------:|:----------:|:--------:|
|
||||
| image | 17.82 | 49.90 | 78.51 | 107.97 |
|
||||
| resize | - | 15.37 | 31.78 | 57.42 |
|
||||
| fir rust | 0.17 | 19.02 | 28.93 | 41.06 |
|
||||
| fir sse4.1 | 0.17 | 7.81 | 13.20 | 19.09 |
|
||||
| fir avx2 | 0.17 | 6.37 | 8.58 | 13.58 |
|
||||
| image | 17.75 | 50.70 | 79.91 | 110.49 |
|
||||
| resize | - | 15.29 | 31.49 | 56.96 |
|
||||
| fir rust | 0.17 | 19.19 | 27.03 | 38.05 |
|
||||
| fir sse4.1 | 0.17 | 7.77 | 13.31 | 19.07 |
|
||||
| fir avx2 | 0.17 | 6.40 | 8.64 | 13.76 |
|
||||
|
||||
### Resize LA16 (luma with alpha channel) image (U16x2) 4928x3279 => 852x567
|
||||
|
||||
@@ -162,6 +162,6 @@ Pipeline:
|
||||
|
||||
| | Nearest | Bilinear | CatmullRom | Lanczos3 |
|
||||
|------------|:-------:|:--------:|:----------:|:--------:|
|
||||
| fir rust | 0.18 | 33.83 | 53.19 | 72.56 |
|
||||
| fir sse4.1 | 0.18 | 21.88 | 33.94 | 46.75 |
|
||||
| fir avx2 | 0.18 | 15.20 | 21.89 | 29.11 |
|
||||
| fir rust | 0.18 | 33.83 | 53.37 | 72.47 |
|
||||
| fir sse4.1 | 0.18 | 21.96 | 34.14 | 46.69 |
|
||||
| fir avx2 | 0.18 | 15.22 | 21.90 | 29.04 |
|
||||
Reference in New Issue
Block a user