@@ -5,10 +5,10 @@ A test to benchmark the performance of this module relative to alternatives.
5
5
## The contenders
6
6
7
7
* [ jimp] ( https://www.npmjs.com/package/jimp ) v0.16.1 - Image processing in pure JavaScript. Provides bicubic interpolation.
8
- * [ mapnik] ( https://www.npmjs.org/package/mapnik ) v4.5.5 - Whilst primarily a map renderer, Mapnik contains bitmap image utilities.
8
+ * [ mapnik] ( https://www.npmjs.org/package/mapnik ) v4.5.6 - Whilst primarily a map renderer, Mapnik contains bitmap image utilities.
9
9
* [ imagemagick] ( https://www.npmjs.com/package/imagemagick ) v0.1.3 - Supports filesystem only and "* has been unmaintained for a long time* ".
10
10
* [ gm] ( https://www.npmjs.com/package/gm ) v1.23.1 - Fully featured wrapper around GraphicsMagick's ` gm ` command line utility.
11
- * sharp v0.27 .0 / libvips v8.10.5 - Caching within libvips disabled to ensure a fair comparison.
11
+ * sharp v0.28 .0 / libvips v8.10.6 - Caching within libvips disabled to ensure a fair comparison.
12
12
13
13
## The task
14
14
@@ -18,25 +18,25 @@ then compress to JPEG at a "quality" setting of 80.
18
18
19
19
## Test environment
20
20
21
- * AWS EC2 eu-west-1 [ c5d.large ] ( https://aws.amazon.com/ec2/instance-types/c5/ ) (2x Xeon Platinum 8275CL CPU @ 3.00GHz )
22
- * Ubuntu 20.10 (ami-046cdbcee95cdd75c )
23
- * Node.js v14.15.3
21
+ * AWS EC2 eu-west-1 [ c5ad.xlarge ] ( https://aws.amazon.com/ec2/instance-types/c5/ ) (4x AMD EPYC 7R32 )
22
+ * Ubuntu 20.10 (ami-03f10415e8b0bfb86 )
23
+ * Node.js v14.16.0
24
24
25
25
## Results
26
26
27
27
| Module | Input | Output | Ops/sec | Speed-up |
28
28
| :----------------- | :----- | :----- | ------: | -------: |
29
- | jimp | buffer | buffer | 0.77 | 1.0 |
30
- | mapnik | buffer | buffer | 3.39 | 4.4 |
31
- | gm | buffer | buffer | 4.30 | 5.6 |
32
- | gm | file | file | 4.33 | 5.6 |
33
- | imagemagick | file | file | 4.39 | 5.7 |
34
- | sharp | stream | stream | 23.81 | 30.9 |
35
- | sharp | file | file | 25.09 | 32.6 |
36
- | sharp | buffer | buffer | 25 .60 | 33.2 |
29
+ | jimp | buffer | buffer | 0.78 | 1.0 |
30
+ | mapnik | buffer | buffer | 3.39 | 4.3 |
31
+ | gm | buffer | buffer | 7.84 | 10.1 |
32
+ | gm | file | file | 9.24 | 11.8 |
33
+ | imagemagick | file | file | 9.37 | 12.0 |
34
+ | sharp | stream | stream | 26.84 | 34.4 |
35
+ | sharp | file | file | 29.76 | 38.2 |
36
+ | sharp | buffer | buffer | 31 .60 | 40.5 |
37
37
38
38
Greater libvips performance can be expected with caching enabled (default)
39
- and using 4 + core machines, especially those with larger L1/L2 CPU caches.
39
+ and using 8 + core machines, especially those with larger L1/L2 CPU caches.
40
40
41
41
The I/O limits of the relevant (de)compression library will generally determine maximum throughput.
42
42
@@ -51,7 +51,7 @@ brew install mapnik
51
51
```
52
52
53
53
``` sh
54
- sudo apt-get install imagemagick libmagick++-dev graphicsmagick libmapnik-dev
54
+ sudo apt-get install build-essential imagemagick libmagick++-dev graphicsmagick libmapnik-dev
55
55
```
56
56
57
57
``` sh
@@ -61,7 +61,7 @@ sudo yum install ImageMagick-devel ImageMagick-c++-devel GraphicsMagick mapnik-d
61
61
``` sh
62
62
git clone https://github.com/lovell/sharp.git
63
63
cd sharp
64
- npm install
64
+ npm install --build-from-source
65
65
cd test/bench
66
66
npm install
67
67
npm test
0 commit comments