From 5546a4f881de3c3e1410ab54b6f91d8936ec60b2 Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Fri, 4 Oct 2013 22:01:16 +0100 Subject: [PATCH] Added GraphicsMagick perf stats --- README.md | 5 +++-- tests/perf.js | 12 ++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 01354053..14d1f17a 100755 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ It is somewhat opinionated in that it only deals with JPEG images, always obeys Under the hood you'll find the blazingly fast [libvips](https://github.com/jcupitt/libvips) image processing library, originally created in 1989 at Birkbeck College and currently maintained by the University of Southampton. -Performance is 4x-8x faster than the imagemagick equivalent, based mainly on the number of CPU cores available. +Performance is 4x-8x faster than ImageMagick and 2x-4x faster than GraphicsMagick, based mainly on the number of CPU cores available. ## Prerequisites @@ -26,7 +26,7 @@ sudo npm install -g node-gyp sudo apt-get install libvips-dev ``` -Please symlink `vips-7.28.pc` (or later, installed with libvips-dev) as `/usr/lib/pkgconfig/vips.pc`. To do this in Ubuntu 13.04 (64-bit), use: +When installed as a package, please symlink `vips-7.28.pc` (or later, installed with libvips-dev) as `/usr/lib/pkgconfig/vips.pc`. To do this in Ubuntu 13.04 (64-bit), use: sudo ln -s /usr/lib/x86_64-linux-gnu/pkgconfig/vips-7.28.pc /usr/lib/pkgconfig/vips.pc @@ -92,6 +92,7 @@ sharp.embedBlack("input.jpg", "output.jpg", 200, 300, function(err) { ### AMD Athlon 4x core 3.3GHz 512KB L2 * imagemagick x 5.55 ops/sec ±0.45% (31 runs sampled) +* gm x 10.31 ops/sec ±3.57% (53 runs sampled) * sharp x 31.52 ops/sec ±8.74% (80 runs sampled) ### AWS t1.micro diff --git a/tests/perf.js b/tests/perf.js index e28c1b58..151790dd 100755 --- a/tests/perf.js +++ b/tests/perf.js @@ -1,5 +1,6 @@ var sharp = require("../index"); var imagemagick = require("imagemagick"); +var gm = require("gm"); var assert = require("assert"); var Benchmark = require("benchmark"); @@ -26,6 +27,17 @@ suite.add("imagemagick", { } }); } +}).add("gm", { + "defer": true, + "fn": function(deferred) { + gm(input).crop(width, height).write(output, function (err) { + if (err) { + throw err; + } else { + deferred.resolve(); + } + }); + } }).add("sharp", { "defer": true, "fn": function(deferred) {