diff --git a/docs/performance.md b/docs/performance.md index 92613316e..b16d3aefe 100644 --- a/docs/performance.md +++ b/docs/performance.md @@ -9,26 +9,26 @@ The I/O limits of the relevant (de)compression library will generally determine ## Contenders -* [jimp](https://www.npmjs.com/package/jimp) v0.22.7 - Image processing in pure JavaScript. +* [jimp](https://www.npmjs.com/package/jimp) v0.22.10 - Image processing in pure JavaScript. * [imagemagick](https://www.npmjs.com/package/imagemagick) v0.1.3 - Supports filesystem only and "*has been unmaintained for a long time*". * [gm](https://www.npmjs.com/package/gm) v1.25.0 - Fully featured wrapper around GraphicsMagick's `gm` command line utility. -* [@squoosh/lib](https://www.npmjs.com/package/@squoosh/lib) v0.4.0 - Image libraries transpiled to WebAssembly, includes GPLv3 code, but "*Project no longer maintained*". +* [@squoosh/lib](https://www.npmjs.com/package/@squoosh/lib) v0.5.3 - Image libraries transpiled to WebAssembly, includes GPLv3 code, but "*Project no longer maintained*". * [@squoosh/cli](https://www.npmjs.com/package/@squoosh/cli) v0.7.3 - Command line wrapper around `@squoosh/lib`, avoids GPLv3 by spawning process, but "*Project no longer maintained*". -* sharp v0.32.0 / libvips v8.14.2 - Caching within libvips disabled to ensure a fair comparison. +* sharp v0.33.0 / libvips v8.15.0 - Caching within libvips disabled to ensure a fair comparison. ## Environment ### AMD64 -* AWS EC2 us-east-2 [c6a.xlarge](https://aws.amazon.com/ec2/instance-types/c6a/) (4x AMD EPYC 7R13) -* Ubuntu 22.04 20230303 (ami-0122295b0eb922138) -* Node.js 16.19.1 +* AWS EC2 us-east-2 [c7a.xlarge](https://aws.amazon.com/ec2/instance-types/c7a/) (4x AMD EPYC 9R14) +* Ubuntu 23.10 [13f233a16be2](https://hub.docker.com/layers/library/ubuntu/23.10/images/sha256-13f233a16be210b57907b98b0d927ceff7571df390701e14fe1f3901b2c4a4d7) +* Node.js 20.10.0 ### ARM64 * AWS EC2 us-east-2 [c7g.xlarge](https://aws.amazon.com/ec2/instance-types/c7g/) (4x ARM Graviton3) -* Ubuntu 22.04 20230303 (ami-0af198159897e7a29) -* Node.js 16.19.1 +* Ubuntu 23.10 [7708743264cb](https://hub.docker.com/layers/library/ubuntu/23.10/images/sha256-7708743264cbb7f6cf7fc13e915faece45a6cdda455748bc55e58e8de3d27b63) +* Node.js 20.10.0 ## Task: JPEG @@ -43,28 +43,28 @@ Note: jimp does not support Lanczos 3, bicubic resampling used instead. | Module | Input | Output | Ops/sec | Speed-up | | :----------------- | :----- | :----- | ------: | -------: | | jimp | buffer | buffer | 0.84 | 1.0 | -| squoosh-cli | file | file | 1.07 | 1.3 | -| squoosh-lib | buffer | buffer | 1.82 | 2.2 | -| gm | buffer | buffer | 8.41 | 10.0 | -| gm | file | file | 8.45 | 10.0 | -| imagemagick | file | file | 8.77 | 10.4 | -| sharp | stream | stream | 36.36 | 43.3 | -| sharp | file | file | 38.67 | 46.0 | -| sharp | buffer | buffer | 39.44 | 47.0 | +| squoosh-cli | file | file | 1.54 | 1.8 | +| squoosh-lib | buffer | buffer | 2.24 | 2.7 | +| imagemagick | file | file | 11.75 | 14.0 | +| gm | buffer | buffer | 12.66 | 15.1 | +| gm | file | file | 12.72 | 15.1 | +| sharp | stream | stream | 48.31 | 57.5 | +| sharp | file | file | 51.42 | 61.2 | +| sharp | buffer | buffer | 52.41 | 62.4 | #### Results: JPEG (ARM64) | Module | Input | Output | Ops/sec | Speed-up | | :----------------- | :----- | :----- | ------: | -------: | -| jimp | buffer | buffer | 1.02 | 1.0 | -| squoosh-cli | file | file | 1.11 | 1.1 | -| squoosh-lib | buffer | buffer | 2.08 | 2.0 | -| gm | buffer | buffer | 8.80 | 8.6 | -| gm | file | file | 10.05 | 9.9 | -| imagemagick | file | file | 10.28 | 10.1 | -| sharp | stream | stream | 26.87 | 26.3 | -| sharp | file | file | 27.88 | 27.3 | -| sharp | buffer | buffer | 28.40 | 27.8 | +| jimp | buffer | buffer | 0.88 | 1.0 | +| squoosh-cli | file | file | 1.18 | 1.3 | +| squoosh-lib | buffer | buffer | 1.99 | 2.3 | +| gm | buffer | buffer | 6.06 | 6.9 | +| gm | file | file | 10.81 | 12.3 | +| imagemagick | file | file | 10.95 | 12.4 | +| sharp | stream | stream | 33.15 | 37.7 | +| sharp | file | file | 34.99 | 39.8 | +| sharp | buffer | buffer | 36.05 | 41.0 | ## Task: PNG @@ -80,25 +80,25 @@ Note: jimp does not support premultiply/unpremultiply. | Module | Input | Output | Ops/sec | Speed-up | | :----------------- | :----- | :----- | ------: | -------: | -| squoosh-cli | file | file | 0.40 | 1.0 | -| squoosh-lib | buffer | buffer | 0.47 | 1.2 | -| gm | file | file | 6.47 | 16.2 | -| jimp | buffer | buffer | 6.60 | 16.5 | -| imagemagick | file | file | 7.08 | 17.7 | -| sharp | file | file | 17.80 | 44.5 | -| sharp | buffer | buffer | 18.02 | 45.0 | +| squoosh-cli | file | file | 0.34 | 1.0 | +| squoosh-lib | buffer | buffer | 0.51 | 1.5 | +| jimp | buffer | buffer | 3.59 | 10.6 | +| gm | file | file | 8.54 | 25.1 | +| imagemagick | file | file | 9.23 | 27.1 | +| sharp | file | file | 25.43 | 74.8 | +| sharp | buffer | buffer | 25.70 | 75.6 | ### Results: PNG (ARM64) | Module | Input | Output | Ops/sec | Speed-up | | :----------------- | :----- | :----- | ------: | -------: | -| squoosh-cli | file | file | 0.40 | 1.0 | -| squoosh-lib | buffer | buffer | 0.48 | 1.2 | -| gm | file | file | 7.20 | 18.0 | -| jimp | buffer | buffer | 7.62 | 19.1 | -| imagemagick | file | file | 7.96 | 19.9 | -| sharp | file | file | 12.97 | 32.4 | -| sharp | buffer | buffer | 13.12 | 32.8 | +| squoosh-cli | file | file | 0.33 | 1.0 | +| squoosh-lib | buffer | buffer | 0.46 | 1.4 | +| jimp | buffer | buffer | 3.51 | 10.6 | +| gm | file | file | 7.47 | 22.6 | +| imagemagick | file | file | 8.06 | 24.4 | +| sharp | file | file | 17.31 | 52.5 | +| sharp | buffer | buffer | 17.66 | 53.5 | ## Running the benchmark test