Convert very slow when using TGA:- (ImageMagick 6.9.1-1)

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
xyri
Posts: 2
Joined: 2015-04-11T03:20:47-07:00
Authentication code: 6789

Convert very slow when using TGA:- (ImageMagick 6.9.1-1)

Post by xyri »

Using TGA:- with convert is really slow compared to saving the output as a TGA file:

$ time convert.exe test.png test.tga
0.00s user 0.00s system 0% cpu 2.708 total

$ convert.exe test.png TGA:- > test.tga
0.00s user 0.00s system 0% cpu 49.859 total

Both of these commands produces identical output file but the second one (and the one I'm needing when piping image data to an another program) takes ~18x more time and it maxes out one CPU core for the whole ~49.9 seconds. I ran these tests under Cygwin but the same thing happens when running via Windows command prompt. Input file was a random 4000x4000 ~6.6 MB PNG file but I have also tested this with several other files having the same kind of of results.

$ convert.exe -version
Version: ImageMagick 6.9.1-1 Q16 x64 2015-03-20 (ImageMagick-6.9.1-1-Q16-x64-static.exe)

System specs: Windows 7 SP1, i7 4790K, 16GB, SSD


Any help to solve this would be appreciated. Thank you.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Convert very slow when using TGA:- (ImageMagick 6.9.1-1)

Post by snibgo »

I doubt if ImageMagick developers can do much about this (unless IM is doing something weird). Redirecting stdout will always be slower than directly writing to a file.
snibgo's IM pages: im.snibgo.com
xyri
Posts: 2
Joined: 2015-04-11T03:20:47-07:00
Authentication code: 6789

Re: Convert very slow when using TGA:- (ImageMagick 6.9.1-1)

Post by xyri »

snibgo wrote:I doubt if ImageMagick developers can do much about this (unless IM is doing something weird). Redirecting stdout will always be slower than directly writing to a file.
It's not with any other image format tho (same input file than in my first post):

JPEG:

$ convert.exe test.png test.jpg
0.00s user 0.00s system 0% cpu 0.872 total

$ convert.exe test.png JPEG:- > test.jpg
0.00s user 0.00s system 0% cpu 0.660 total

TIF:

$ convert.exe test.png test.tif
0.00s user 0.00s system 0% cpu 7.014 total

$ convert.exe test.png TIF:- > test.tif
0.00s user 0.01s system 0% cpu 6.996 total

BMP:

$ convert.exe test.png test.bmp
0.00s user 0.00s system 0% cpu 0.701 total

$ convert.exe test.png BMP:- > test.bmp
0.00s user 0.00s system 0% cpu 0.662 total


With all these tests the STDOUT version is actually faster, so I don't think the problem is in writing to STDOUT but something that happens before it.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Convert very slow when using TGA:- (ImageMagick 6.9.1-1)

Post by snibgo »

Ah, well, that's blown my theory. Sorry. Perhaps a developer can comment.
snibgo's IM pages: im.snibgo.com
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Convert very slow when using TGA:- (ImageMagick 6.9.1-1)

Post by magick »

We can reproduce the problem you posted and we're testing a patch in ImageMagick 6.9.1-2 Beta, available within a few days. Thanks.
Post Reply