Update benchmark results ahead of v0.15.0, ~20% improvement

This commit is contained in:
Lovell Fuller 2016-05-21 10:21:42 +01:00
parent e3cbcb98c0
commit 933989c87d
5 changed files with 29 additions and 27 deletions

View File

@ -41,7 +41,6 @@ Any change that modifies the existing public API should be added to the relevant
| Release | WIP branch | | Release | WIP branch |
| ------: | :--------- | | ------: | :--------- |
| v0.15.0 | outfit |
| v0.16.0 | pencil | | v0.16.0 | pencil |
| v0.17.0 | quill | | v0.17.0 | quill |

View File

@ -4,7 +4,7 @@ The typical use case for this high speed Node.js module
is to convert large images in common formats to is to convert large images in common formats to
smaller, web-friendly JPEG, PNG and WebP images of varying dimensions. smaller, web-friendly JPEG, PNG and WebP images of varying dimensions.
Resizing an image is typically 4x faster than using the Resizing an image is typically 4x-5x faster than using the
quickest ImageMagick and GraphicsMagick settings. quickest ImageMagick and GraphicsMagick settings.
Colour spaces, embedded ICC profiles and alpha transparency channels are all handled correctly. Colour spaces, embedded ICC profiles and alpha transparency channels are all handled correctly.

View File

@ -4,7 +4,7 @@ The typical use case for this high speed Node.js module
is to convert large images in common formats to is to convert large images in common formats to
smaller, web-friendly JPEG, PNG and WebP images of varying dimensions. smaller, web-friendly JPEG, PNG and WebP images of varying dimensions.
Resizing an image is typically 4x faster than using the Resizing an image is typically 4x-5x faster than using the
quickest ImageMagick and GraphicsMagick settings. quickest ImageMagick and GraphicsMagick settings.
Colour spaces, embedded ICC profiles and alpha transparency channels are all handled correctly. Colour spaces, embedded ICC profiles and alpha transparency channels are all handled correctly.

View File

@ -2,42 +2,45 @@
### Test environment ### Test environment
* AWS EC2 [c4.xlarge](http://aws.amazon.com/ec2/instance-types/#c4) (4x E5-2666 v3 @2.90GHz) * AWS EC2 [c4.xlarge](http://aws.amazon.com/ec2/instance-types/#c4) (4x E5-2666 v3 @ 2.90GHz)
* Amazon Linux 2015.09.1 * Amazon Linux AMI 2016.03.1 (HVM), SSD Volume Type
* Node.js v5.5.0 * Node.js v6.2.0
### The contenders ### The contenders
* [jimp](https://www.npmjs.com/package/jimp) v0.2.20 - Image processing in pure JavaScript. Bilinear interpolation only. * [jimp](https://www.npmjs.com/package/jimp) v0.2.24 - Image processing in pure JavaScript. Bilinear interpolation only.
* [lwip](https://www.npmjs.com/package/lwip) v0.0.8 - Wrapper around CImg, compiles dependencies from source. * [lwip](https://www.npmjs.com/package/lwip) v0.0.9 - Wrapper around CImg, compiles dependencies from source.
* [imagemagick-native](https://www.npmjs.com/package/imagemagick-native) @47c7329 - Wrapper around libmagick++, supports Buffers only. * [imagemagick-native](https://www.npmjs.com/package/imagemagick-native) v1.9.2 - Wrapper around libmagick++, supports Buffers only.
* [imagemagick](https://www.npmjs.com/package/imagemagick) v0.1.3 - Supports filesystem only and "*has been unmaintained for a long time*". * [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.21.0 - Fully featured wrapper around GraphicsMagick's `gm` command line utility. * [gm](https://www.npmjs.com/package/gm) v1.22.0 - Fully featured wrapper around GraphicsMagick's `gm` command line utility.
* sharp v0.13.0 / libvips v8.2.2 - Caching within libvips disabled to ensure a fair comparison. * sharp v0.15.0 / libvips v8.3.1 - Caching within libvips disabled to ensure a fair comparison.
### The task ### The task
Decompress a 2725x2225 JPEG image, resize to 720x480 using bicubic interpolation (where available), then compress to JPEG. Decompress a 2725x2225 JPEG image,
resize to 720x480 using Lanczos 3 resampling (where available),
then compress to JPEG.
### Results ### Results
| Module | Input | Output | Ops/sec | Speed-up | | Module | Input | Output | Ops/sec | Speed-up |
| :----------------- | :----- | :----- | ------: | -------: | | :----------------- | :----- | :----- | ------: | -------: |
| jimp (bilinear) | file | file | 1.04 | 1.0 | | jimp (bilinear) | file | file | 0.94 | 1.0 |
| jimp (bilinear) | buffer | buffer | 1.07 | 1.0 | | jimp (bilinear) | buffer | buffer | 0.98 | 1.0 |
| lwip | file | file | 1.13 | 1.1 | | lwip | file | file | 1.14 | 1.2 |
| lwip | buffer | buffer | 1.13 | 1.1 | | lwip | buffer | buffer | 1.14 | 1.2 |
| imagemagick-native | buffer | buffer | 1.65 | 1.6 | | imagemagick-native | buffer | buffer | 1.66 | 1.8 |
| imagemagick | file | file | 5.02 | 4.8 | | imagemagick | file | file | 5.08 | 5.4 |
| gm | buffer | buffer | 5.36 | 5.2 | | gm | buffer | buffer | 5.43 | 5.7 |
| gm | file | file | 5.39 | 5.2 | | gm | file | file | 5.46 | 5.8 |
| sharp | stream | stream | 22.00 | 21.2 | | sharp | stream | stream | 26.52 | 28.2 |
| sharp | file | file | 22.87 | 22.0 | | sharp | file | file | 28.16 | 30.0 |
| sharp | file | buffer | 23.03 | 22.1 | | sharp | file | buffer | 28.27 | 30.1 |
| sharp | buffer | file | 23.10 | 22.2 | | sharp | buffer | file | 28.42 | 30.2 |
| sharp | buffer | buffer | 23.21 | 22.3 | | sharp | buffer | buffer | 28.42 | 30.2 |
Greater performance can be expected with caching enabled (default) and using 8+ core machines. Greater libvips performance can be expected with caching enabled (default)
and using 8+ core machines, especially those with larger L1/L2 CPU caches.
The I/O limits of the relevant (de)compression library will generally determine maximum throughput. The I/O limits of the relevant (de)compression library will generally determine maximum throughput.

View File

@ -14,7 +14,7 @@
"imagemagick": "^0.1.3", "imagemagick": "^0.1.3",
"imagemagick-native": "^1.9.2", "imagemagick-native": "^1.9.2",
"jimp": "^0.2.24", "jimp": "^0.2.24",
"lwip": "^0.0.8", "lwip": "^0.0.9",
"semver": "^5.1.0" "semver": "^5.1.0"
}, },
"license": "Apache-2.0", "license": "Apache-2.0",