File: benchmarks.rst

package info (click to toggle)
graphicsmagick 1.3.20-3%2Bdeb8u1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 38,472 kB
  • ctags: 14,330
  • sloc: ansic: 220,724; sh: 24,578; cpp: 18,199; perl: 3,365; makefile: 2,359; tcl: 2,208; python: 1,280
file content (149 lines) | stat: -rw-r--r-- 5,152 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
.. -*- mode: rst -*-
.. This text is in reStucturedText format, so it may look a bit odd.
.. See http://docutils.sourceforge.net/rst.html for details.

=============================================================
GraphicsMagick vs ImageMagick Benchmarks
=============================================================

.. contents::
  :local:

Foreword
=========

This page used to document benchmark results which compared
GraphicsMagick 1.3.8 performance to ImageMagick 6.5.8-10 performance.
We found that GraphicsMagick was usually considerably faster at
executing image processing operations from the command line than
ImageMagick 6.5.8-10 was. One ImageMagick algorithm ran as much as 770
times slower.  GraphicsMagick clearly ran much more efficiently under
Microsoft Windows.

We now find that a simple head to head performance comparison between
GraphicsMagick and recent ImageMagick is no longer possible because
ImageMagick has changed the meanings of the existing arguments.  In
particular, we discovered that ImageMagick filter arguments producing
convolution matrices are now producing lower-order convolution
matrices representing perhaps an order of magnitude less work given
the same arguments.  The resulting images are visually substantially
less filtered.  Using the same command-line filter arguments causes
GraphicsMagick to appear slower when it is actually doing far more
work than ImageMagick.

Due to it not being feasable to do a head to head performance
measurement between GraphicsMagick and ImageMagick, we have decided to
not post results at the moment.  However, the strategy and a simple
benchmark driver script are still provided for those who want to do
their own performance comparisons between GraphicsMagick and
ImageMagick.

Strategy
========

The benchmark focuses on the ability to process many medium sized
HD-resolution (1920x1080 pixels) images. In order to prevent disk I/O
from being a factor, we use a small input image and tile it to create
a larger input image via the "tile:" coder. The processed image is
sent to the "null:" coder so that file writes to a slow disk are also
not a factor.  Static executables are used and executed via full paths
in order to minimize variability from the execution environment. In
order to obtain accurate and useful timing, we use the bash shell to
execute the command 40 times and see how long it takes. This is a very
simple benchmark approach which is quite representative of the
performance that the typical user observes.

This new benchmark reveals the following performance criteria:

  * Basic execution overhead of the software.
  
  * Image processing algorithmic efficiency.
  
  * Efficacy of OpenMP enhancements.

The Benchmark
=============

The benchmark is quite simple. It reads a list of commands to execute
from a file named "commands.txt" and times how long it takes to
execute each command 40 times using GraphicsMagick and ImageMagick.

Here is the simple benchmark script::

  #!/usr/bin/env bash
  #
  # Measure the performance between two 'convert' commands by
  # executing a subcommand through many iterations and seeing
  # the total time that it takes.
  #
  # Written by Bob Friesenhahn, October 2008
  #

  # GraphicsMagick
  convert1='/usr/local/bin/gm convert'
  #convert1='/c/Program\ Files/GraphicsMagick-1.3.8-Q16/gm.exe convert'

  # ImageMagick
  convert2='/usr/local/bin/convert'
  #convert2='/c/Program\ Files/ImageMagick-6.5.9-Q16/convert.exe'

  # Input file specification
  input_image='-size 1920x1080 tile:model.pnm'

  # Ouput file specification
  output_image="null:"

  # Should not need to change any of the rest
  typeset -i iterations=40
  echo "Convert-1:   ${convert1}"
  echo "Version:     `eval "${convert1}" -version | head -1`"
  echo "Convert-2:   ${convert2}"
  echo "Version:     `eval "${convert2}" -version | head -1`"
  echo "Date:        `date`"
  echo "Host:        `uname -n`"
  echo "OS:          `uname -s`"
  echo "Release:     `uname -r`"
  echo "Arch:        `uname -p`"
  echo "Input File:  ${input_image}"
  echo "Output File: ${output_image}"
  echo "Threads:     ${OMP_NUM_THREADS:-1}"
  echo "Iterations:  ${iterations}"
  echo "========================================================================================"
  echo
  typeset -i count=0 i=0
  cat commands.txt | while read subcommand
  do
    echo ${subcommand}
  
    command1="${convert1} ${input_image} ${subcommand} ${output_image}"
    i=0
    count=$iterations
    time while ((i < count))
    do
      eval "${command1}"
      let i=i+1
    done
    sleep 1
  
    command2="${convert2} ${input_image} ${subcommand} ${output_image}"
    i=0
    count=$iterations
    time while ((i < count))
    do
      eval "${command2}"
      let i=i+1
    done
  
    echo
    sleep 1
  done 2>&1


--------------------------------------------------------------------------

| Copyright (C) 2008 - 2014 GraphicsMagick Group

This program is covered by multiple licenses, which are described in
Copyright.txt. You should have received a copy of Copyright.txt with this
package; otherwise see http://www.graphicsmagick.org/Copyright.html.