Skip to content
Create a gist now

Instantly share code, notes, and snippets.

@tjfontaine /test.js
Last active

simple comparison of identify command vs binding
var imagick = require('imagick');
var imagemagick = require('imagemagick');
var path = require('path');
var assert = require('assert');
args = [
console.log('using:', args.join(' '));
function test(count, start, lib, args, end) {
if (count <= 0) {
lib.identify(args, function (error, metadata) {
assert.strictEqual(metadata.trim(), '~~~245~~~66~~~72 Undefined~~~Zip');
test(--count, start, lib, args, end);
var COUNT = 1000;
test(COUNT,, imagick, args, function (start) {
console.log('imagick did', COUNT, 'in', (, 'seconds');
test(COUNT,, imagemagick, args, function (start) {
console.log('imagemagick did', COUNT, 'in', (, 'seconds');
/* output
using: -format ~~~%w~~~%h~~~%x~~~%C /home/tjfontaine/development/test/logo.png
imagick did 1000 in 0.323 seconds
imagemagick did 1000 in 5.366 seconds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.