Updated benchmarks for Wasm32.

This commit is contained in:
Kirill Kuzminykh committed 2026-10-25 21:28:37 +03:00
1 parent ce36aeb20e
commit ccc2bbc3d0
5 files changed
+64 -70

No files matched your search

+11 -21
View File
@@ -2,7 +2,7 @@
### Added
- Added support of optimisation with the help of `Wasm32 SIMD128` for all `F32`
- Added support of optimization with the help of `Wasm32 SIMD128` for all `F32`
based pixel types ([#61](https://github.com/Cykooz/fast_image_resize/pull/61))
The convolution accumulation uses the fused `f64x2_relaxed_madd` instruction
@@ -48,8 +48,7 @@ This version was yanked due to a backwards compatibility break - a new feature
### Added
- Added support of some variants of `ImageBuffer` type from the `image` crate
([#57](https://github.com/Cykooz/fast_image_resize/issues/57)).
- Added support of some variants of `ImageBuffer` type from the `image` crate ([#57](https://github.com/Cykooz/fast_image_resize/issues/57)).
## [5.4.0] - 2025-11-28
@@ -70,8 +69,7 @@ This version was yanked due to a backwards compatibility break - a new feature
### Fixed
- Fixed a "divide by zero" error in case of using multithreading to resize
images with particular sizes
([#55](https://github.com/Cykooz/fast_image_resize/issues/55)).
images with particular sizes ([#55](https://github.com/Cykooz/fast_image_resize/issues/55)).
## [5.2.1] - 2025-07-27
@@ -84,8 +82,7 @@ This version was yanked due to a backwards compatibility break - a new feature
### Added
- Added support of `DynamicImage::ImageRgb32F` and `DynamicImage::ImageRgba32F`
form the `image` crate
([#50](https://github.com/Cykooz/fast_image_resize/pull/50)).
form the `image` crate ([#50](https://github.com/Cykooz/fast_image_resize/pull/50)).
## [5.1.4] - 2025-05-16
@@ -101,11 +98,9 @@ This version was yanked due to a backwards compatibility break - a new feature
### Fixed
- Fixed error in `NEON` implementation of `MulDiv::multiply_alpha()` and
`MulDiv::multiply_alpha_inplace()` for `U8x2` pixels
([#49](https://github.com/Cykooz/fast_image_resize/issues/49)).
`MulDiv::multiply_alpha_inplace()` for `U8x2` pixels ([#49](https://github.com/Cykooz/fast_image_resize/issues/49)).
- Replaced the internal crate `testing` on the corresponding module in the
`tests` directory
([#48](https://github.com/Cykooz/fast_image_resize/issues/48)).
`tests` directory ([#48](https://github.com/Cykooz/fast_image_resize/issues/48)).
## [5.1.2] - 2025-02-16
@@ -174,8 +169,7 @@ This version was yanked due to a backwards compatibility break - a new feature
## Fixed
- Fixed error in `NEON` implementation of `MulDiv::multiply_alpha()` and
`MulDiv::multiply_alpha_inplace()` for `U8x2` pixels
([#49](https://github.com/Cykooz/fast_image_resize/issues/49)).
`MulDiv::multiply_alpha_inplace()` for `U8x2` pixels ([#49](https://github.com/Cykooz/fast_image_resize/issues/49)).
## [4.2.1] - 2024-07-24
@@ -408,16 +402,14 @@ fn my_resize(
### Fixed
- Fixed size of rows in cropped `ImageViewMut` created by
`ImageViewMut::crop` method
([#17](https://github.com/Cykooz/fast_image_resize/issues/17)).
`ImageViewMut::crop` method ([#17](https://github.com/Cykooz/fast_image_resize/issues/17)).
## [2.7.2] - 2023-05-04
### Fixed
- Added using of (read|write)_unaligned for unaligned pointers on `arm64` and
`wasm32` architectures.
([#15](https://github.com/Cykooz/fast_image_resize/issues/15)).
`wasm32` architectures. ([#15](https://github.com/Cykooz/fast_image_resize/issues/15)).
## [2.7.1] - 2023-04-28
@@ -442,8 +434,7 @@ fn my_resize(
- Slightly improved speed of `Convolution` implementation for `U8x2` images and
`Wasm32 SIMD128` instructions.
- Method `Image::buffer_mut()` was made public
([#14](https://github.com/Cykooz/fast_image_resize/pull/14))
- Method `Image::buffer_mut()` was made public ([#14](https://github.com/Cykooz/fast_image_resize/pull/14))
## [2.5.0] - 2023-01-29
@@ -618,8 +609,7 @@ fn my_resize(
- Added partial optimisation for convolution of U8 images with helps of
`SSE4.1` instructions.
- Allowed to create an instance of `Image`, `ImageVew` and `ImageViewMut`
from a buffer larger than necessary
([#5](https://github.com/Cykooz/fast_image_resize/issues/5)).
from a buffer larger than necessary ([#5](https://github.com/Cykooz/fast_image_resize/issues/5)).
- Breaking changes:
- Removed methods: `Image::from_vec_u32()`, `Image::from_slice_u32()`.
- Removed error `InvalidBufferSizeError`.
+2 -3
View File
@@ -28,8 +28,7 @@ Supported pixel formats and available optimizations:
## Rust version
Rust 1.95 and 1.96 (actually LLVM)
have [regression](https://github.com/rust-lang/rust/issues/157456)
Rust 1.95-1.98 (actually LLVM) have [regression](https://github.com/rust-lang/rust/issues/157456)
in Wasm32 SIMD128 implementation. It affects the implementation of dividing U8x4 pixels by
alpha channel for Wasm32 SIMD128.
@@ -62,7 +61,7 @@ the `no_std` feature:
```toml
[dependencies]
fast_image_resize = { version = "6.0", default-features = false, features = ["no_std"] }
fast_image_resize = { version = "6.2", default-features = false, features = ["no_std"] }
```
## Some benchmarks in single-threaded mode for x86_64
+4 -4
View File
@@ -8,12 +8,12 @@ Environment:
- CPU: AMD Ryzen 9 5950X
- RAM: DDR4 4000 MHz
{% endif -%}
- Ubuntu 24.04 (linux 7.0.0)
- Rust 1.97.1
- Ubuntu 26.04 (linux 7.0.0)
- Rust 1.99
- criterion = "0.7.0"
- fast_image_resize = "6.0.1"
- fast_image_resize = "6.2.0"
{% if arch_id == "wasm32" -%}
- wasmtime = "47.0.1"
- wasmtime = "50.0.0"
{% endif %}
Other libraries used to compare of resizing speed:
+42 -42
View File
@@ -6,11 +6,11 @@ Environment:
- CPU: AMD Ryzen 9 5950X
- RAM: DDR4 4000 MHz
- Ubuntu 24.04 (linux 7.0.0)
- Rust 1.97.1
- Ubuntu 26.04 (linux 7.0.0)
- Rust 1.99
- criterion = "0.7.0"
- fast_image_resize = "6.0.1"
- wasmtime = "47.0.1"
- fast_image_resize = "6.2.0"
- wasmtime = "50.0.0"
Other libraries used to compare of resizing speed:
@@ -40,10 +40,10 @@ Pipeline:
| | Nearest | Box | Bilinear | Bicubic | Lanczos3 |
|-------------|:-------:|:-----:|:--------:|:-------:|:--------:|
| image | 22.24 | - | 100.02 | 178.71 | 254.58 |
| resize | 10.81 | 32.08 | 58.26 | 110.90 | 173.44 |
| fir rust | 0.30 | 34.77 | 64.66 | 124.81 | 186.33 |
| fir simd128 | 0.30 | 5.77 | 8.81 | 15.43 | 22.49 |
| image | 22.57 | - | 100.71 | 180.93 | 258.63 |
| resize | 11.78 | 31.04 | 56.33 | 107.84 | 168.70 |
| fir rust | 0.33 | 34.87 | 65.16 | 125.66 | 188.25 |
| fir simd128 | 0.33 | 5.61 | 8.40 | 14.91 | 21.96 |
<!-- bench_compare_rgb end -->
@@ -62,9 +62,9 @@ Pipeline:
| | Nearest | Box | Bilinear | Bicubic | Lanczos3 |
|-------------|:-------:|:-----:|:--------:|:-------:|:--------:|
| resize | 11.41 | 38.23 | 73.39 | 138.00 | 211.01 |
| fir rust | 0.25 | 88.42 | 129.85 | 213.80 | 298.47 |
| fir simd128 | 0.25 | 13.29 | 16.48 | 24.05 | 32.50 |
| resize | 11.58 | 39.10 | 77.47 | 144.76 | 225.54 |
| fir rust | 0.25 | 88.31 | 128.66 | 209.95 | 290.85 |
| fir simd128 | 0.25 | 13.08 | 16.20 | 23.81 | 32.39 |
<!-- bench_compare_rgba end -->
@@ -82,10 +82,10 @@ Pipeline:
| | Nearest | Box | Bilinear | Bicubic | Lanczos3 |
|-------------|:-------:|:-----:|:--------:|:-------:|:--------:|
| image | 19.77 | - | 75.47 | 130.61 | 184.25 |
| resize | 7.13 | 16.40 | 27.14 | 51.54 | 75.86 |
| fir rust | 0.21 | 13.09 | 23.50 | 44.67 | 66.77 |
| fir simd128 | 0.21 | 2.63 | 3.46 | 5.46 | 8.06 |
| image | 19.04 | - | 75.39 | 130.45 | 183.91 |
| resize | 7.31 | 17.44 | 28.25 | 52.43 | 77.00 |
| fir rust | 0.21 | 13.26 | 23.66 | 44.90 | 66.92 |
| fir simd128 | 0.21 | 2.55 | 3.40 | 5.40 | 8.03 |
<!-- bench_compare_l end -->
@@ -106,8 +106,8 @@ Pipeline:
| | Nearest | Box | Bilinear | Bicubic | Lanczos3 |
|-------------|:-------:|:-----:|:--------:|:-------:|:--------:|
| fir rust | 0.19 | 44.14 | 64.38 | 105.64 | 147.63 |
| fir simd128 | 0.19 | 7.67 | 9.54 | 13.86 | 18.60 |
| fir rust | 0.19 | 44.60 | 65.30 | 108.09 | 150.57 |
| fir simd128 | 0.19 | 8.06 | 9.64 | 13.76 | 18.20 |
<!-- bench_compare_la end -->
@@ -125,10 +125,10 @@ Pipeline:
| | Nearest | Box | Bilinear | Bicubic | Lanczos3 |
|-------------|:-------:|:-----:|:--------:|:-------:|:--------:|
| image | 22.37 | - | 93.58 | 164.15 | 237.91 |
| resize | 10.16 | 31.39 | 57.52 | 110.59 | 174.47 |
| fir rust | 0.38 | 32.44 | 50.07 | 87.39 | 126.54 |
| fir simd128 | 0.36 | 38.94 | 68.75 | 128.67 | 188.66 |
| image | 22.21 | - | 100.09 | 178.34 | 256.03 |
| resize | 11.57 | 29.88 | 52.21 | 104.66 | 164.94 |
| fir rust | 0.39 | 32.53 | 49.07 | 87.14 | 123.43 |
| fir simd128 | 0.39 | 38.35 | 68.16 | 128.54 | 188.49 |
<!-- bench_compare_rgb16 end -->
@@ -147,9 +147,9 @@ Pipeline:
| | Nearest | Box | Bilinear | Bicubic | Lanczos3 |
|-------------|:-------:|:-----:|:--------:|:-------:|:--------:|
| resize | 12.52 | 38.62 | 72.34 | 139.18 | 206.96 |
| fir rust | 0.47 | 85.87 | 113.63 | 170.33 | 229.21 |
| fir simd128 | 0.44 | 59.33 | 96.57 | 171.30 | 247.36 |
| resize | 13.03 | 38.98 | 73.34 | 141.54 | 208.31 |
| fir rust | 0.55 | 81.12 | 100.91 | 140.94 | 183.19 |
| fir simd128 | 0.55 | 60.83 | 98.30 | 172.97 | 248.10 |
<!-- bench_compare_rgba16 end -->
@@ -167,10 +167,10 @@ Pipeline:
| | Nearest | Box | Bilinear | Bicubic | Lanczos3 |
|-------------|:-------:|:-----:|:--------:|:-------:|:--------:|
| image | 20.01 | - | 83.55 | 145.72 | 207.00 |
| resize | 7.09 | 16.93 | 28.27 | 52.38 | 77.69 |
| fir rust | 0.20 | 17.48 | 24.52 | 42.30 | 58.87 |
| fir simd128 | 0.19 | 14.29 | 22.45 | 41.29 | 60.30 |
| image | 18.85 | - | 82.44 | 145.14 | 206.58 |
| resize | 7.53 | 16.78 | 27.62 | 52.19 | 76.32 |
| fir rust | 0.19 | 17.96 | 24.56 | 42.83 | 60.77 |
| fir simd128 | 0.19 | 16.31 | 25.07 | 43.84 | 63.59 |
<!-- bench_compare_l16 end -->
@@ -191,8 +191,8 @@ Pipeline:
| | Nearest | Box | Bilinear | Bicubic | Lanczos3 |
|-------------|:-------:|:-----:|:--------:|:-------:|:--------:|
| fir rust | 0.24 | 43.09 | 55.53 | 80.12 | 105.02 |
| fir simd128 | 0.24 | 30.67 | 49.72 | 88.30 | 128.09 |
| fir rust | 0.27 | 43.60 | 57.43 | 87.19 | 116.41 |
| fir simd128 | 0.27 | 33.11 | 51.75 | 90.60 | 129.95 |
<!-- bench_compare_la16 end -->
@@ -210,10 +210,10 @@ Pipeline:
| | Nearest | Box | Bilinear | Bicubic | Lanczos3 |
|-------------|:-------:|:-----:|:--------:|:-------:|:--------:|
| image | 14.59 | - | 49.07 | 86.95 | 122.78 |
| resize | 6.97 | 14.93 | 23.45 | 44.40 | 66.04 |
| fir rust | 0.27 | 10.68 | 18.70 | 35.92 | 59.26 |
| fir simd128 | 0.25 | 10.68 | 19.01 | 35.94 | 59.39 |
| image | 14.14 | - | 48.08 | 87.26 | 121.74 |
| resize | 6.81 | 15.59 | 23.78 | 46.79 | 71.51 |
| fir rust | 0.25 | 10.67 | 18.62 | 36.07 | 58.93 |
| fir simd128 | 0.25 | 6.38 | 8.75 | 15.07 | 21.56 |
<!-- bench_compare_l32f end -->
@@ -239,8 +239,8 @@ Pipeline:
| | Nearest | Box | Bilinear | Bicubic | Lanczos3 |
|-------------|:-------:|:-----:|:--------:|:-------:|:--------:|
| fir rust | 0.44 | 33.72 | 46.43 | 73.05 | 101.52 |
| fir simd128 | 0.44 | 33.70 | 46.40 | 73.01 | 101.54 |
| fir rust | 0.63 | 35.12 | 47.03 | 73.82 | 101.61 |
| fir simd128 | 0.63 | 26.00 | 32.89 | 46.08 | 60.63 |
<!-- bench_compare_la32f end -->
@@ -258,10 +258,10 @@ Pipeline:
| | Nearest | Box | Bilinear | Bicubic | Lanczos3 |
|-------------|:-------:|:-----:|:--------:|:-------:|:--------:|
| image | 16.32 | - | 68.30 | 121.95 | 181.16 |
| resize | 12.14 | 21.20 | 34.63 | 62.46 | 91.27 |
| fir rust | 1.14 | 27.06 | 48.08 | 92.09 | 138.51 |
| fir simd128 | 1.06 | 27.05 | 48.05 | 92.08 | 138.67 |
| image | 15.84 | - | 63.90 | 114.99 | 169.86 |
| resize | 12.68 | 20.78 | 34.82 | 63.87 | 93.00 |
| fir rust | 1.28 | 26.75 | 48.15 | 92.28 | 138.60 |
| fir simd128 | 1.28 | 18.43 | 28.67 | 50.96 | 72.31 |
<!-- bench_compare_rgb32f end -->
@@ -283,7 +283,7 @@ Pipeline:
| | Nearest | Box | Bilinear | Bicubic | Lanczos3 |
|-------------|:-------:|:-----:|:--------:|:-------:|:--------:|
| fir rust | 1.63 | 58.53 | 81.37 | 126.81 | 176.77 |
| fir simd128 | 1.64 | 58.50 | 81.35 | 126.79 | 176.73 |
| fir rust | 1.74 | 59.58 | 82.52 | 127.75 | 178.55 |
| fir simd128 | 1.74 | 47.77 | 58.47 | 83.82 | 109.24 |
<!-- bench_compare_rgba32f end -->
+5
View File
@@ -16,6 +16,11 @@ Install additional toolchains:
```
Install [Wasmtime](https://wasmtime.dev/).
Create symlink for Wasmtime to run tests from RustRover:
```shell
ln -s ~/.wasmtime/bin/wasmtime ~/.local/bin/wasmtime
```
# Tests
Run tests with saving result images as files in `./data` directory: