Skip to content

Commit da0b594

Browse files
committed
Docs: update benchmarks for latest versions, add ARM64 results
1 parent 78dada9 commit da0b594

1 file changed

Lines changed: 38 additions & 22 deletions

File tree

docs/performance.md

Lines changed: 38 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,47 +2,63 @@
22

33
A test to benchmark the performance of this module relative to alternatives.
44

5+
Greater libvips performance can be expected with caching enabled (default)
6+
and using 8+ core machines, especially those with larger L1/L2 CPU caches.
7+
8+
The I/O limits of the relevant (de)compression library will generally determine maximum throughput.
9+
510
## The contenders
611

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.9 - Whilst primarily a map renderer, Mapnik contains bitmap image utilities.
12+
* [jimp](https://www.npmjs.com/package/jimp) v0.16.2 - Image processing in pure JavaScript. Provides bicubic interpolation.
913
* [imagemagick](https://www.npmjs.com/package/imagemagick) v0.1.3 - Supports filesystem only and "*has been unmaintained for a long time*".
10-
* [gm](https://www.npmjs.com/package/gm) v1.23.1 - Fully featured wrapper around GraphicsMagick's `gm` command line utility.
14+
* [gm](https://www.npmjs.com/package/gm) v1.25.0 - Fully featured wrapper around GraphicsMagick's `gm` command line utility.
1115
* [@squoosh/lib](https://www.npmjs.com/package/@squoosh/lib) v0.4.0 - Image libraries transpiled to WebAssembly, includes GPLv3 code.
1216
* [@squoosh/cli](https://www.npmjs.com/package/@squoosh/cli) v0.7.2 - Command line wrapper around `@squoosh/lib`, avoids GPLv3 by spawning process.
13-
* sharp v0.31.0 / libvips v8.13.1 - Caching within libvips disabled to ensure a fair comparison.
17+
* sharp v0.31.3 / libvips v8.13.3 - Caching within libvips disabled to ensure a fair comparison.
1418

1519
## The task
1620

1721
Decompress a 2725x2225 JPEG image,
1822
resize to 720x588 using Lanczos 3 resampling (where available),
1923
then compress to JPEG at a "quality" setting of 80.
2024

21-
## Test environment
25+
## Results
2226

23-
* AWS EC2 eu-west-1 [c6a.xlarge](https://aws.amazon.com/ec2/instance-types/c6a/) (4x AMD EPYC 7R13)
24-
* Ubuntu 22.04 (ami-051f7c00cb18501ee)
25-
* Node.js 16.17.0
27+
### AMD64
2628

27-
## Results
29+
* AWS EC2 eu-west-1 [c6a.xlarge](https://aws.amazon.com/ec2/instance-types/c6a/) (4x AMD EPYC 7R13)
30+
* Ubuntu 22.04 (ami-026e72e4e468afa7b)
31+
* Node.js 16.19.0
2832

2933
| Module | Input | Output | Ops/sec | Speed-up |
3034
| :----------------- | :----- | :----- | ------: | -------: |
31-
| jimp | buffer | buffer | 0.96 | 1.0 |
32-
| squoosh-cli | file | file | 1.10 | 1.1 |
33-
| squoosh-lib | buffer | buffer | 1.87 | 1.9 |
34-
| mapnik | buffer | buffer | 3.48 | 3.6 |
35-
| gm | buffer | buffer | 8.53 | 8.9 |
36-
| gm | file | file | 8.60 | 9.0 |
37-
| imagemagick | file | file | 9.30 | 9.7 |
38-
| sharp | stream | stream | 32.86 | 34.2 |
39-
| sharp | file | file | 34.82 | 36.3 |
40-
| sharp | buffer | buffer | 35.41 | 36.9 |
35+
| jimp | buffer | buffer | 0.82 | 1.0 |
36+
| squoosh-cli | file | file | 1.05 | 1.3 |
37+
| squoosh-lib | buffer | buffer | 1.19 | 1.5 |
38+
| gm | buffer | buffer | 8.47 | 10.3 |
39+
| gm | file | file | 8.58 | 10.5 |
40+
| imagemagick | file | file | 9.23 | 11.3 |
41+
| sharp | stream | stream | 33.23 | 40.5 |
42+
| sharp | file | file | 35.22 | 43.0 |
43+
| sharp | buffer | buffer | 35.70 | 43.5 |
4144

42-
Greater libvips performance can be expected with caching enabled (default)
43-
and using 8+ core machines, especially those with larger L1/L2 CPU caches.
45+
### ARM64
4446

45-
The I/O limits of the relevant (de)compression library will generally determine maximum throughput.
47+
* AWS EC2 eu-west-1 [c7g.xlarge](https://aws.amazon.com/ec2/instance-types/c7g/) (4x ARM Graviton3)
48+
* Ubuntu 22.04 (ami-02142ceceb3933ff5)
49+
* Node.js 16.19.0
50+
51+
| Module | Input | Output | Ops/sec | Speed-up |
52+
| :----------------- | :----- | :----- | ------: | -------: |
53+
| jimp | buffer | buffer | 0.84 | 1.0 |
54+
| squoosh-cli | file | file | 1.12 | 1.3 |
55+
| squoosh-lib | buffer | buffer | 2.11 | 2.5 |
56+
| gm | buffer | buffer | 10.39 | 12.4 |
57+
| gm | file | file | 10.40 | 12.4 |
58+
| imagemagick | file | file | 10.73 | 12.8 |
59+
| sharp | stream | stream | 33.63 | 40.0 |
60+
| sharp | file | file | 34.91 | 41.6 |
61+
| sharp | buffer | buffer | 35.72 | 42.5 |
4662

4763
## Running the benchmark test
4864

0 commit comments

Comments
 (0)