Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Speed and memory use

John Cupitt edited this pageDec 5, 2024 ·34 revisions

We've written programs using number of different image processing systemto load a TIFF image, crop 100 pixels off every edge, shrink by 10% withbilinear interpolation, sharpen with a 3x3 convolution and save again. It'sa trivial test, but it does give some idea of the speed and memory behaviourof these libraries (and it's also quite fun to compare the code).

See also our mainBenchmarks page for a more complex benchmark andtimings on a variety of machines. TheWhy is libvips quick page tries toexplain why libvips does well on this test.

Results

AMD Ryzen Threadripper PRO 3955WX 16-Cores, Ubuntu 22.10

SoftwareRun time
(secs real)
Memory
(peak RSS MB)
Times slower
libvips 8.14 Lua0.37760.97
libvips 8.14 C/C++0.38841.00
libvips 8.14 PHP0.411031.07
tiffcp0.455811.18
libvips 8.14 Python0.471331.24
libvips 8.14 Ruby0.491071.29
libvips 8.14, JPEG images0.981772.57
libvips 8.14 CLI1.08832.84
Pillow-SIMD 9.0.0see 11.19852.89
GraphicsMagick 1.41.4219823.73
libvips 8.14, one thread1.49523.92
nip21.591584.18
GEGL 0.4.38-1, JPEG imagessee 46.137515.0
libgd 2.3.3-6, JPEG imagessee 24.910405.00
NetPBM 1.131.702895.15
ImageJ 1.532.595426.82
OpenCV 4.62.857917.5
rmagick 6.9.11-602.8727857.55
OpenImageIO 2.3.18see 102.9122237.65
convert 6.9.11-602.9920027.86
imwand.py 6.9.11-603.0820158.11
ExactImage 1.0.2-9see 33.214758.44
Imlib2 1.7.4-2see 93.3910188.92
FreeImage 3.18.0see 74.2175211.08
imagick 6.9.11-606.61201817.39
Pike 8.0.7025.90137617.88
GMIC 2.9.4-49.87299525.97
Octave 7.2.0-1see 527.08650571.26

Graphically

This graph was made by runningps very quickly and piping the output toasimple scriptthat calculated total RSS for all processes associated with a task.

This is a fancier one generated byvipsprofile showing the memorybehaviour of libvips. The bottom graph shows total memory, the uppertraces show threads calculating useful results (green), threads blockedon synchronisation (red) and memory allocations (white ticks). There's ablog postwith some more detail on how this was made.

Notes

The benchmarks plus a simple driver program are in agithub repository. See the READMEfor details.

Except where noted, all timings are for a 10,000 by 10,000 pixel 8-bit RGB imagein uncompressed tiled TIFF format. Each test was run with something like:

time ./vips.sh tmp/x.tif tmp/x2.tif

On a quiet system with the quickest real time of five runs recorded. There'sno attempt to clear the disc cache, so disc speed should not be a factor. Thepeak memory column was found by sampling RES withps usingthisscript.I used the systems as packaged for Ubuntu unless otherwise indicated. Ilast ran these tests on 4 Jan 2023 and used the current stableversion of every package except where otherwise noted.Tracker wasdisabled.

The benchmark hardware has 16 cores, so systems like Pillow,ymagine, OpenCV and ImageScience, which do not thread automatically, arelower in the table than they should be. On a single-core machine the tablewould look quite different. There's a separate entry for libvips with asingle worker thread for comparison, although even when running with justa single worker libvips will still use a separate write-behind thread.

This test does a lot of file IO and relatively little processing, whichflatters libvips.

Some systems, like ImageJ, GEGL and nip2, have relativelylong start-up times and this hurts their position in the table.

The libvips command-line version generates a huge amount of disc traffic whichmakes it unsuitable for certain applications. This is not really consideredin this table.

  1. Pillow is single-threaded, so the fairest comparison for raw processingspeed would be against vips-1thread.

  2. libgd will not read tiff, so I used jpeg. Their "times slower"column is against libvips with a jpeg source. A lot of time is therefore beingspent in libjpeg, which is slightly unfair to libvips.

  3. ExactImage will not read tiled tiff, so the benchmark uses a strip tifffor this test.

  4. GEGL does not really focus on batch-style processing -- it targetsinteractive applications, like paint programs. It was run with JPEG images, with 16 threads, and timed against apyvips program which exactly matches GEGL's processing.

  5. Octave aims to be a very high-level prototyping language and is notprimarily targeting speed.

  6. FreeImage does not have a sharpening or convolution operation so Iskipped that part of the benchmark.

  7. Imlib2 is spending almost all its time in image input and output.

  8. The OpenImageIO test usesoiiotool, which may not be the best way totest the library.

Implementations

Seethe repository.

Clone this wiki locally

[8]ページ先頭

©2009-2025 Movatter.jp