Updated benchmark results for x86_64 arch.

This commit is contained in:
Kirill Kuzminykh
2024-07-05 23:05:00 +03:00
parent f1bf0bb51a
commit 564a28ac9d
9 changed files with 172 additions and 155 deletions
Generated
+64 -65
View File
@@ -113,7 +113,7 @@ checksum = "0ae92a5119aa49cdbcf6b9f893fe4e1d98b04ccbf82ee0584ad948a44a734dea"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.67",
"syn 2.0.68",
]
[[package]]
@@ -165,15 +165,15 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "bitflags"
version = "2.5.0"
version = "2.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1"
checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de"
[[package]]
name = "bitstream-io"
version = "2.3.0"
version = "2.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7c12d1856e42f0d817a835fe55853957c85c8c8a470114029143d3f12671446e"
checksum = "415f8399438eb5e4b2f73ed3152a3448b98149dda642a957ee704e1daa5cf1d8"
[[package]]
name = "block-buffer"
@@ -232,9 +232,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5"
[[package]]
name = "cc"
version = "1.0.99"
version = "1.0.104"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "96c51067fd44124faa7f870b4b1c969379ad32b2ba805aa959430ceaa384f695"
checksum = "74b6a57f98764a267ff415d50a25e6e166f3831a5071af4995296ea97d210490"
dependencies = [
"jobserver",
"libc",
@@ -326,9 +326,9 @@ dependencies = [
[[package]]
name = "clap"
version = "4.5.7"
version = "4.5.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5db83dced34638ad474f39f250d7fea9598bdd239eaced1bdf45d597da0f433f"
checksum = "84b3edb18336f4df585bc9aa31dd99c036dfa5dc5e9a2939a722a188f3a8970d"
dependencies = [
"clap_builder",
"clap_derive",
@@ -346,9 +346,9 @@ dependencies = [
[[package]]
name = "clap_builder"
version = "4.5.7"
version = "4.5.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f7e204572485eb3fbf28f871612191521df159bc3e15a9f5064c66dba3a8c05f"
checksum = "c1c09dd5ada6c6c78075d6fd0da3f90d8080651e2d6cc8eb2f1aaa4034ced708"
dependencies = [
"anstream",
"anstyle",
@@ -358,14 +358,14 @@ dependencies = [
[[package]]
name = "clap_derive"
version = "4.5.5"
version = "4.5.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c780290ccf4fb26629baa7a1081e68ced113f1d3ec302fa5948f1c381ebf06c6"
checksum = "2bac35c6dafb060fd4d275d9a4ffae97917c13a6327903a8be2153cd964f7085"
dependencies = [
"heck",
"proc-macro2",
"quote",
"syn 2.0.67",
"syn 2.0.68",
]
[[package]]
@@ -512,9 +512,9 @@ dependencies = [
[[package]]
name = "either"
version = "1.12.0"
version = "1.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b"
checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0"
[[package]]
name = "env_filter"
@@ -664,7 +664,7 @@ version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0bf760ebf69878d9fd8f110c89703d90ce35095324d1f1edcb595c63945ee757"
dependencies = [
"bitflags 2.5.0",
"bitflags 2.6.0",
"ignore",
"walkdir",
]
@@ -808,7 +808,7 @@ checksum = "c34819042dc3d3971c46c2190835914dfbe0c3c13f61449b2997f4e9722dfa60"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.67",
"syn 2.0.68",
]
[[package]]
@@ -948,9 +948,9 @@ dependencies = [
[[package]]
name = "log"
version = "0.4.21"
version = "0.4.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c"
checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24"
[[package]]
name = "loop9"
@@ -1005,7 +1005,7 @@ version = "0.29.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46"
dependencies = [
"bitflags 2.5.0",
"bitflags 2.6.0",
"cfg-if",
"cfg_aliases",
"libc",
@@ -1029,9 +1029,9 @@ checksum = "0676bb32a98c1a483ce53e500a81ad9c3d5b3f7c920c28c24e9cb0980d0b5bc8"
[[package]]
name = "num-bigint"
version = "0.4.5"
version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7"
checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9"
dependencies = [
"num-integer",
"num-traits",
@@ -1056,7 +1056,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.67",
"syn 2.0.68",
]
[[package]]
@@ -1123,9 +1123,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"
[[package]]
name = "pest"
version = "2.7.10"
version = "2.7.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "560131c633294438da9f7c4b08189194b20946c8274c6b9e38881a7874dc8ee8"
checksum = "cd53dff83f26735fdc1ca837098ccf133605d794cdae66acfc2bfac3ec809d95"
dependencies = [
"memchr",
"thiserror",
@@ -1134,9 +1134,9 @@ dependencies = [
[[package]]
name = "pest_derive"
version = "2.7.10"
version = "2.7.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "26293c9193fbca7b1a3bf9b79dc1e388e927e6cacaa78b4a3ab705a1d3d41459"
checksum = "2a548d2beca6773b1c244554d36fcf8548a8a58e74156968211567250e48e49a"
dependencies = [
"pest",
"pest_generator",
@@ -1144,22 +1144,22 @@ dependencies = [
[[package]]
name = "pest_generator"
version = "2.7.10"
version = "2.7.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3ec22af7d3fb470a85dd2ca96b7c577a1eb4ef6f1683a9fe9a8c16e136c04687"
checksum = "3c93a82e8d145725dcbaf44e5ea887c8a869efdcc28706df2d08c69e17077183"
dependencies = [
"pest",
"pest_meta",
"proc-macro2",
"quote",
"syn 2.0.67",
"syn 2.0.68",
]
[[package]]
name = "pest_meta"
version = "2.7.10"
version = "2.7.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d7a240022f37c361ec1878d646fc5b7d7c4d28d5946e1a80ad5a7a4f4ca0bdcd"
checksum = "a941429fea7e08bedec25e4f6785b6ffaacc6b755da98df5ef3e7dcf4a124c4f"
dependencies = [
"once_cell",
"pest",
@@ -1254,7 +1254,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8021cf59c8ec9c432cfc2526ac6b8aa508ecaf29cd415f271b8406c1b851c3fd"
dependencies = [
"quote",
"syn 2.0.67",
"syn 2.0.68",
]
[[package]]
@@ -1348,9 +1348,9 @@ dependencies = [
[[package]]
name = "ravif"
version = "0.11.5"
version = "0.11.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bc13288f5ab39e6d7c9d501759712e6969fcc9734220846fc9ed26cae2cc4234"
checksum = "67376f469e7e7840d0040bbf4b9b3334005bb167f814621326e4c7ab8cd6e944"
dependencies = [
"avif-serialize",
"imgref",
@@ -1416,7 +1416,6 @@ version = "0.8.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3e29f584c07a8396c5e2eee0bd8d7aec5c8d9e0a3c2333806fd2ec1d2a5b080"
dependencies = [
"rayon",
"rgb",
]
@@ -1436,9 +1435,9 @@ dependencies = [
[[package]]
name = "rgb"
version = "0.8.37"
version = "0.8.40"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "05aaa8004b64fd573fc9d002f4e632d51ad4f026c2b5ba95fcb6c2f32c2c47d8"
checksum = "a7439be6844e40133eda024efd85bf07f59d0dd2f59b10c00dd6cfb92cc5c741"
dependencies = [
"bytemuck",
]
@@ -1481,14 +1480,14 @@ checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.67",
"syn 2.0.68",
]
[[package]]
name = "serde_json"
version = "1.0.117"
version = "1.0.120"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3"
checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5"
dependencies = [
"itoa",
"ryu",
@@ -1580,9 +1579,9 @@ dependencies = [
[[package]]
name = "syn"
version = "2.0.67"
version = "2.0.68"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ff8655ed1d86f3af4ee3fd3263786bc14245ad17c4c7e85ba7187fb3ae028c90"
checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9"
dependencies = [
"proc-macro2",
"quote",
@@ -1655,7 +1654,7 @@ checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.67",
"syn 2.0.68",
]
[[package]]
@@ -1847,7 +1846,7 @@ dependencies = [
"once_cell",
"proc-macro2",
"quote",
"syn 2.0.67",
"syn 2.0.68",
"wasm-bindgen-shared",
]
@@ -1869,7 +1868,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.67",
"syn 2.0.68",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
@@ -1915,9 +1914,9 @@ dependencies = [
[[package]]
name = "windows-targets"
version = "0.52.5"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb"
checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
dependencies = [
"windows_aarch64_gnullvm",
"windows_aarch64_msvc",
@@ -1931,51 +1930,51 @@ dependencies = [
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.52.5"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263"
checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
[[package]]
name = "windows_aarch64_msvc"
version = "0.52.5"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6"
checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
[[package]]
name = "windows_i686_gnu"
version = "0.52.5"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670"
checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
[[package]]
name = "windows_i686_gnullvm"
version = "0.52.5"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9"
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
[[package]]
name = "windows_i686_msvc"
version = "0.52.5"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf"
checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
[[package]]
name = "windows_x86_64_gnu"
version = "0.52.5"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9"
checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.52.5"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596"
checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
[[package]]
name = "windows_x86_64_msvc"
version = "0.52.5"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0"
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
[[package]]
name = "winnow"
+1 -1
View File
@@ -40,7 +40,7 @@ only_u8x4 = [] # This can be used to experiment with the crate's code.
[dev-dependencies]
fast_image_resize = { path = ".", features = ["for_testing"] }
resize = "0.8.4"
resize = { version = "0.8.4", default-features = false, features = ["std"] }
rgb = "0.8.37"
png = "0.17.13"
serde = { version = "1.0", features = ["serde_derive"] }
+26 -20
View File
@@ -4,7 +4,7 @@
[![crates.io](https://img.shields.io/crates/v/fast_image_resize.svg?logo=rust)](https://crates.io/crates/fast_image_resize)
[![docs.rs](https://img.shields.io/badge/docs.rs-fast__image__resize-66c2a5?logo=docs.rs)](https://docs.rs/fast_image_resize)
Rust library for fast image resizing with using of SIMD instructions.
Rust library for fast **single-threaded** image resizing with using of SIMD instructions.
[CHANGELOG](https://github.com/Cykooz/fast_image_resize/blob/main/CHANGELOG.md)
@@ -54,10 +54,11 @@ _All benchmarks:_
Other libraries used to compare of resizing speed:
- image (<https://crates.io/crates/image>)
- resize (<https://crates.io/crates/resize>)
- libvips (single-threaded mode, cache disabled)
- resize (<https://crates.io/crates/resize>, single-threaded mode)
- libvips (single-threaded mode)
<!-- bench_compare_rgb start -->
### Resize RGB8 image (U8x3) 4928x3279 => 852x567
Pipeline:
@@ -69,15 +70,17 @@ Pipeline:
| | Nearest | Box | Bilinear | Bicubic | Lanczos3 |
|------------|:-------:|:-----:|:--------:|:-------:|:--------:|
| image | 32.06 | - | 94.81 | 153.34 | 212.23 |
| resize | 9.12 | 26.76 | 52.27 | 97.57 | 144.36 |
| libvips | 7.75 | 59.45 | 19.98 | 30.79 | 39.94 |
| fir rust | 0.29 | 11.91 | 16.56 | 26.11 | 37.89 |
| fir sse4.1 | 0.29 | 4.09 | 5.68 | 9.79 | 15.45 |
| fir avx2 | 0.29 | 3.10 | 3.98 | 6.82 | 13.30 |
| image | 32.17 | - | 94.60 | 153.14 | 211.14 |
| resize | 9.18 | 26.68 | 49.76 | 96.06 | 141.84 |
| libvips | 7.75 | 59.58 | 19.81 | 30.46 | 39.96 |
| fir rust | 0.29 | 11.99 | 16.56 | 25.93 | 37.85 |
| fir sse4.1 | 0.29 | 4.13 | 5.67 | 9.77 | 15.52 |
| fir avx2 | 0.29 | 3.13 | 3.98 | 6.88 | 13.18 |
<!-- bench_compare_rgb end -->
<!-- bench_compare_rgba start -->
### Resize RGBA8 image (U8x4) 4928x3279 => 852x567
Pipeline:
@@ -91,14 +94,16 @@ Pipeline:
| | Nearest | Box | Bilinear | Bicubic | Lanczos3 |
|------------|:-------:|:------:|:--------:|:-------:|:--------:|
| resize | 11.45 | 42.73 | 85.20 | 147.41 | 211.63 |
| libvips | 9.77 | 120.67 | 189.16 | 336.71 | 500.29 |
| fir rust | 0.19 | 21.84 | 26.36 | 36.95 | 50.38 |
| fir sse4.1 | 0.19 | 10.22 | 12.42 | 17.84 | 24.86 |
| fir avx2 | 0.19 | 7.85 | 8.87 | 13.82 | 22.10 |
| resize | 11.98 | 43.60 | 86.90 | 147.95 | 211.64 |
| libvips | 10.06 | 122.00 | 188.57 | 336.42 | 499.80 |
| fir rust | 0.19 | 22.02 | 26.95 | 38.41 | 51.70 |
| fir sse4.1 | 0.19 | 10.32 | 12.59 | 18.10 | 24.95 |
| fir avx2 | 0.19 | 7.75 | 8.88 | 13.78 | 22.12 |
<!-- bench_compare_rgba end -->
<!-- bench_compare_l start -->
### Resize L8 image (U8) 4928x3279 => 852x567
Pipeline:
@@ -111,12 +116,13 @@ Pipeline:
| | Nearest | Box | Bilinear | Bicubic | Lanczos3 |
|------------|:-------:|:-----:|:--------:|:-------:|:--------:|
| image | 28.75 | - | 60.74 | 89.30 | 117.34 |
| resize | 6.83 | 11.03 | 20.67 | 43.74 | 67.86 |
| libvips | 4.66 | 25.00 | 9.74 | 13.19 | 17.94 |
| fir rust | 0.15 | 4.54 | 5.69 | 8.05 | 12.22 |
| fir sse4.1 | 0.15 | 1.70 | 2.16 | 3.34 | 5.64 |
| fir avx2 | 0.15 | 1.74 | 1.90 | 2.31 | 4.28 |
| image | 28.76 | - | 60.68 | 89.41 | 117.41 |
| resize | 6.40 | 11.24 | 20.84 | 42.92 | 68.93 |
| libvips | 4.66 | 25.06 | 9.67 | 13.27 | 17.99 |
| fir rust | 0.15 | 4.74 | 6.02 | 8.41 | 12.62 |
| fir sse4.1 | 0.15 | 1.67 | 2.14 | 3.31 | 5.61 |
| fir avx2 | 0.15 | 1.74 | 1.91 | 2.31 | 4.16 |
<!-- bench_compare_l end -->
## Examples
+3
View File
@@ -6,6 +6,8 @@ use fast_image_resize::MulDiv;
use fast_image_resize::PixelType;
use testing::cpu_ext_into_str;
use crate::utils::pin_process_to_cpu0;
mod utils;
// Multiplies by alpha
@@ -170,6 +172,7 @@ fn bench_alpha(bench_group: &mut utils::BenchGroup) {
}
fn main() {
pin_process_to_cpu0();
let res = utils::run_bench(bench_alpha, "Bench Alpha");
println!("{}", utils::build_md_table(&res));
}
+3
View File
@@ -3,6 +3,8 @@ use fast_image_resize::images::Image;
use fast_image_resize::pixels::U8x3;
use testing::PixelTestingExt;
use crate::utils::pin_process_to_cpu0;
mod utils;
pub fn bench_color_mapper(bench_group: &mut utils::BenchGroup) {
@@ -23,5 +25,6 @@ pub fn bench_color_mapper(bench_group: &mut utils::BenchGroup) {
}
fn main() {
pin_process_to_cpu0();
utils::run_bench(bench_color_mapper, "Color mapper");
}
+6 -2
View File
@@ -4,6 +4,8 @@ use fast_image_resize::ResizeOptions;
use fast_image_resize::{CpuExtensions, FilterType, PixelType, ResizeAlg, Resizer};
use testing::{cpu_ext_into_str, PixelTestingExt};
use crate::utils::pin_process_to_cpu0;
mod utils;
const NEW_SIZE: u32 = 695;
@@ -216,12 +218,14 @@ pub fn resize_bench(bench_group: &mut utils::BenchGroup) {
native_nearest_u8_bench(bench_group);
}
fn main() {
fn main1() {
pin_process_to_cpu0();
let results = utils::run_bench(resize_bench, "Resize");
println!("{}", utils::build_md_table(&results));
}
fn main2() {
fn main() {
pin_process_to_cpu0();
let results = utils::run_bench(resize_in_one_dimension_bench, "Resize one dimension");
println!("{}", utils::build_md_table(&results));
}
+2 -2
View File
@@ -19,9 +19,9 @@ Environment:
Other libraries used to compare of resizing speed:
- image = "0.25.1" (<https://crates.io/crates/image>)
- resize = "0.8.4" (<https://crates.io/crates/resize>)
- resize = "0.8.4" (<https://crates.io/crates/resize>, single-threaded mode)
{% if arch_id != "wasm32" -%}
- libvips = "8.12.1" (single-threaded mode, cache disabled)
- libvips = "8.12.1" (single-threaded mode)
{% endif %}
Resize algorithms:
+3 -1
View File
@@ -24,7 +24,9 @@ pub fn run_bench<F>(bench_fn: F, name: &str) -> Vec<BenchResult>
where
F: FnOnce(&mut BenchGroup),
{
pin_process_to_cpu0();
if env::var("PIN_TO_CPU0").is_ok() {
pin_process_to_cpu0();
}
let arch_id = get_arch_id_and_name().0;
let output_dir = criterion_output_directory().join(arch_id);
+64 -64
View File
@@ -14,8 +14,8 @@ Environment:
Other libraries used to compare of resizing speed:
- image = "0.25.1" (<https://crates.io/crates/image>)
- resize = "0.8.4" (<https://crates.io/crates/resize>)
- libvips = "8.12.1" (single-threaded mode, cache disabled)
- resize = "0.8.4" (<https://crates.io/crates/resize>, single-threaded mode)
- libvips = "8.12.1" (single-threaded mode)
Resize algorithms:
@@ -40,12 +40,12 @@ Pipeline:
| | Nearest | Box | Bilinear | Bicubic | Lanczos3 |
|------------|:-------:|:-----:|:--------:|:-------:|:--------:|
| image | 32.06 | - | 94.81 | 153.34 | 212.23 |
| resize | 9.12 | 26.76 | 52.27 | 97.57 | 144.36 |
| libvips | 7.75 | 59.45 | 19.98 | 30.79 | 39.94 |
| fir rust | 0.29 | 11.91 | 16.56 | 26.11 | 37.89 |
| fir sse4.1 | 0.29 | 4.09 | 5.68 | 9.79 | 15.45 |
| fir avx2 | 0.29 | 3.10 | 3.98 | 6.82 | 13.30 |
| image | 32.17 | - | 94.60 | 153.14 | 211.14 |
| resize | 9.18 | 26.68 | 49.76 | 96.06 | 141.84 |
| libvips | 7.75 | 59.58 | 19.81 | 30.46 | 39.96 |
| fir rust | 0.29 | 11.99 | 16.56 | 25.93 | 37.85 |
| fir sse4.1 | 0.29 | 4.13 | 5.67 | 9.77 | 15.52 |
| fir avx2 | 0.29 | 3.13 | 3.98 | 6.88 | 13.18 |
<!-- bench_compare_rgb end -->
@@ -64,11 +64,11 @@ Pipeline:
| | Nearest | Box | Bilinear | Bicubic | Lanczos3 |
|------------|:-------:|:------:|:--------:|:-------:|:--------:|
| resize | 11.45 | 42.73 | 85.20 | 147.41 | 211.63 |
| libvips | 9.77 | 120.67 | 189.16 | 336.71 | 500.29 |
| fir rust | 0.19 | 21.84 | 26.36 | 36.95 | 50.38 |
| fir sse4.1 | 0.19 | 10.22 | 12.42 | 17.84 | 24.86 |
| fir avx2 | 0.19 | 7.85 | 8.87 | 13.82 | 22.10 |
| resize | 11.98 | 43.60 | 86.90 | 147.95 | 211.64 |
| libvips | 10.06 | 122.00 | 188.57 | 336.42 | 499.80 |
| fir rust | 0.19 | 22.02 | 26.95 | 38.41 | 51.70 |
| fir sse4.1 | 0.19 | 10.32 | 12.59 | 18.10 | 24.95 |
| fir avx2 | 0.19 | 7.75 | 8.88 | 13.78 | 22.12 |
<!-- bench_compare_rgba end -->
@@ -86,12 +86,12 @@ Pipeline:
| | Nearest | Box | Bilinear | Bicubic | Lanczos3 |
|------------|:-------:|:-----:|:--------:|:-------:|:--------:|
| image | 28.75 | - | 60.74 | 89.30 | 117.34 |
| resize | 6.83 | 11.03 | 20.67 | 43.74 | 67.86 |
| libvips | 4.66 | 25.00 | 9.74 | 13.19 | 17.94 |
| fir rust | 0.15 | 4.54 | 5.69 | 8.05 | 12.22 |
| fir sse4.1 | 0.15 | 1.70 | 2.16 | 3.34 | 5.64 |
| fir avx2 | 0.15 | 1.74 | 1.90 | 2.31 | 4.28 |
| image | 28.76 | - | 60.68 | 89.41 | 117.41 |
| resize | 6.40 | 11.24 | 20.84 | 42.92 | 68.93 |
| libvips | 4.66 | 25.06 | 9.67 | 13.27 | 17.99 |
| fir rust | 0.15 | 4.74 | 6.02 | 8.41 | 12.62 |
| fir sse4.1 | 0.15 | 1.67 | 2.14 | 3.31 | 5.61 |
| fir avx2 | 0.15 | 1.74 | 1.91 | 2.31 | 4.16 |
<!-- bench_compare_l end -->
@@ -112,10 +112,10 @@ Pipeline:
| | Nearest | Box | Bilinear | Bicubic | Lanczos3 |
|------------|:-------:|:-----:|:--------:|:-------:|:--------:|
| libvips | 6.45 | 72.42 | 117.32 | 205.22 | 293.11 |
| fir rust | 0.17 | 18.09 | 20.67 | 25.58 | 32.87 |
| fir sse4.1 | 0.17 | 6.18 | 7.20 | 9.61 | 13.48 |
| fir avx2 | 0.17 | 4.34 | 4.91 | 6.53 | 9.59 |
| libvips | 6.42 | 73.21 | 118.10 | 205.49 | 292.37 |
| fir rust | 0.18 | 18.67 | 21.14 | 25.86 | 32.98 |
| fir sse4.1 | 0.17 | 6.18 | 7.21 | 9.60 | 13.48 |
| fir avx2 | 0.17 | 4.35 | 4.92 | 6.48 | 9.60 |
<!-- bench_compare_la end -->
@@ -133,12 +133,12 @@ Pipeline:
| | Nearest | Box | Bilinear | Bicubic | Lanczos3 |
|------------|:-------:|:-----:|:--------:|:-------:|:--------:|
| image | 31.04 | - | 87.07 | 139.57 | 190.73 |
| resize | 8.09 | 26.30 | 49.97 | 96.79 | 143.58 |
| libvips | 16.00 | 62.91 | 54.53 | 102.92 | 125.23 |
| fir rust | 0.35 | 30.77 | 47.74 | 81.36 | 115.72 |
| fir sse4.1 | 0.35 | 16.16 | 23.62 | 38.31 | 54.64 |
| fir avx2 | 0.35 | 13.85 | 19.15 | 29.74 | 36.50 |
| image | 31.17 | - | 86.80 | 138.46 | 191.10 |
| resize | 8.16 | 26.79 | 50.87 | 97.41 | 144.44 |
| libvips | 16.00 | 63.08 | 54.33 | 102.53 | 125.07 |
| fir rust | 0.33 | 30.74 | 47.64 | 81.28 | 115.50 |
| fir sse4.1 | 0.33 | 16.24 | 23.65 | 38.31 | 54.69 |
| fir avx2 | 0.33 | 13.88 | 19.29 | 29.86 | 36.75 |
<!-- bench_compare_rgb16 end -->
@@ -157,11 +157,11 @@ Pipeline:
| | Nearest | Box | Bilinear | Bicubic | Lanczos3 |
|------------|:-------:|:------:|:--------:|:-------:|:--------:|
| resize | 12.27 | 43.48 | 83.80 | 144.81 | 207.30 |
| libvips | 22.68 | 128.29 | 205.54 | 364.11 | 533.24 |
| fir rust | 0.39 | 62.43 | 82.36 | 122.70 | 164.59 |
| fir sse4.1 | 0.39 | 31.92 | 42.43 | 63.89 | 85.88 |
| fir avx2 | 0.39 | 20.45 | 26.17 | 36.72 | 48.24 |
| resize | 13.57 | 44.09 | 84.32 | 145.34 | 207.68 |
| libvips | 22.77 | 128.72 | 205.37 | 366.05 | 537.03 |
| fir rust | 0.40 | 63.43 | 84.58 | 127.16 | 171.87 |
| fir sse4.1 | 0.40 | 32.01 | 42.48 | 63.86 | 86.06 |
| fir avx2 | 0.40 | 20.60 | 26.04 | 36.66 | 47.97 |
<!-- bench_compare_rgba16 end -->
@@ -179,12 +179,12 @@ Pipeline:
| | Nearest | Box | Bilinear | Bicubic | Lanczos3 |
|------------|:-------:|:-----:|:--------:|:-------:|:--------:|
| image | 28.43 | - | 61.77 | 90.52 | 119.06 |
| resize | 6.37 | 11.09 | 20.38 | 42.28 | 67.60 |
| libvips | 7.63 | 26.04 | 21.73 | 36.34 | 45.95 |
| fir rust | 0.17 | 14.63 | 20.81 | 30.42 | 43.41 |
| fir sse4.1 | 0.17 | 5.31 | 7.48 | 12.85 | 18.79 |
| fir avx2 | 0.17 | 5.55 | 6.45 | 8.50 | 13.61 |
| image | 29.50 | - | 61.96 | 91.03 | 119.53 |
| resize | 6.40 | 11.10 | 20.93 | 43.22 | 68.96 |
| libvips | 7.45 | 26.23 | 21.80 | 36.47 | 46.00 |
| fir rust | 0.17 | 14.84 | 21.62 | 30.25 | 42.89 |
| fir sse4.1 | 0.17 | 5.40 | 7.49 | 12.91 | 18.84 |
| fir avx2 | 0.17 | 5.49 | 6.42 | 8.54 | 13.70 |
<!-- bench_compare_l16 end -->
@@ -205,10 +205,10 @@ Pipeline:
| | Nearest | Box | Bilinear | Bicubic | Lanczos3 |
|------------|:-------:|:-----:|:--------:|:-------:|:--------:|
| libvips | 12.15 | 79.49 | 133.83 | 232.22 | 327.14 |
| fir rust | 0.19 | 31.57 | 40.69 | 62.09 | 84.65 |
| fir sse4.1 | 0.19 | 14.86 | 21.03 | 33.10 | 45.59 |
| fir avx2 | 0.19 | 11.57 | 14.84 | 21.66 | 28.89 |
| libvips | 12.51 | 79.48 | 133.81 | 232.12 | 326.55 |
| fir rust | 0.19 | 32.88 | 40.97 | 62.61 | 84.70 |
| fir sse4.1 | 0.19 | 15.01 | 21.19 | 33.27 | 45.87 |
| fir avx2 | 0.19 | 11.84 | 15.10 | 22.03 | 29.10 |
<!-- bench_compare_la16 end -->
@@ -226,12 +226,12 @@ Pipeline:
| | Nearest | Box | Bilinear | Bicubic | Lanczos3 |
|------------|:-------:|:-----:|:--------:|:-------:|:--------:|
| image | 24.45 | - | 49.71 | 78.69 | 105.12 |
| resize | 5.02 | 8.82 | 13.42 | 29.90 | 45.04 |
| libvips | 6.48 | 25.81 | 21.50 | 42.64 | 70.48 |
| fir rust | 0.19 | 9.60 | 15.08 | 29.70 | 51.94 |
| fir sse4.1 | 0.19 | 5.05 | 7.28 | 11.54 | 16.87 |
| fir avx2 | 0.19 | 4.64 | 5.52 | 7.12 | 10.63 |
| image | 24.55 | - | 49.54 | 78.44 | 104.51 |
| resize | 5.03 | 8.64 | 13.85 | 30.14 | 45.81 |
| libvips | 5.96 | 25.74 | 21.52 | 42.24 | 71.71 |
| fir rust | 0.20 | 9.87 | 14.93 | 29.66 | 51.71 |
| fir sse4.1 | 0.20 | 5.06 | 7.31 | 11.59 | 16.89 |
| fir avx2 | 0.20 | 4.75 | 5.55 | 7.13 | 10.69 |
<!-- bench_compare_l32f end -->
@@ -252,10 +252,10 @@ Pipeline:
| | Nearest | Box | Bilinear | Bicubic | Lanczos3 |
|------------|:-------:|:-----:|:--------:|:-------:|:--------:|
| libvips | 11.97 | 69.97 | 101.99 | 177.48 | 252.49 |
| fir rust | 0.39 | 21.50 | 29.51 | 47.46 | 70.36 |
| fir sse4.1 | 0.39 | 16.46 | 21.12 | 30.52 | 40.27 |
| fir avx2 | 0.39 | 15.32 | 17.33 | 22.63 | 28.11 |
| libvips | 11.58 | 70.05 | 101.70 | 176.48 | 252.74 |
| fir rust | 0.38 | 22.75 | 30.35 | 49.41 | 71.81 |
| fir sse4.1 | 0.38 | 17.63 | 21.97 | 31.34 | 41.09 |
| fir avx2 | 0.38 | 15.91 | 18.46 | 23.27 | 28.78 |
<!-- bench_compare_la32f end -->
@@ -273,12 +273,12 @@ Pipeline:
| | Nearest | Box | Bilinear | Bicubic | Lanczos3 |
|------------|:-------:|:-----:|:--------:|:-------:|:--------:|
| image | 26.87 | - | 64.40 | 106.65 | 147.88 |
| resize | 8.89 | 14.23 | 23.78 | 47.82 | 70.56 |
| libvips | 11.71 | 60.78 | 53.26 | 114.11 | 193.66 |
| fir rust | 0.88 | 16.43 | 26.93 | 50.27 | 74.94 |
| fir sse4.1 | 0.88 | 12.63 | 19.38 | 32.27 | 46.71 |
| fir avx2 | 0.88 | 10.95 | 13.96 | 20.31 | 29.14 |
| image | 26.32 | - | 62.99 | 104.89 | 147.02 |
| resize | 8.97 | 16.30 | 24.52 | 48.25 | 72.16 |
| libvips | 11.75 | 60.36 | 52.63 | 113.20 | 197.67 |
| fir rust | 0.83 | 16.39 | 26.95 | 50.36 | 75.58 |
| fir sse4.1 | 0.83 | 12.65 | 19.17 | 32.15 | 46.64 |
| fir avx2 | 0.83 | 11.03 | 14.10 | 20.86 | 29.43 |
<!-- bench_compare_rgb32f end -->
@@ -300,9 +300,9 @@ Pipeline:
| | Nearest | Box | Bilinear | Bicubic | Lanczos3 |
|------------|:-------:|:------:|:--------:|:-------:|:--------:|
| libvips | 23.22 | 111.20 | 140.22 | 250.45 | 386.72 |
| fir rust | 1.06 | 36.13 | 45.93 | 70.53 | 93.30 |
| fir sse4.1 | 1.06 | 32.10 | 40.35 | 58.59 | 77.88 |
| fir avx2 | 1.06 | 29.64 | 31.75 | 41.44 | 51.22 |
| libvips | 23.22 | 111.26 | 140.16 | 249.97 | 381.64 |
| fir rust | 1.01 | 35.88 | 45.64 | 70.56 | 93.29 |
| fir sse4.1 | 1.01 | 32.41 | 39.49 | 57.88 | 77.38 |
| fir avx2 | 1.01 | 28.39 | 31.49 | 40.73 | 49.47 |
<!-- bench_compare_rgba32f end -->