Re: ReadImage TGA very slow

[email protected] Mon, 1 Oct 2018 22:17:36 +0200
Newsgroups gmane.comp.video.graphicsmagick.help
Message-ID <[email protected]>
On Mon, Oct 01, 2018 at 03:03:18PM -0500, Bob Friesenhahn wrote:
> On Mon, 1 Oct 2018, [email protected] wrote:
> >
> > I don't understand why TGA loading is more than ten times slower than the other
> > formats, while being as simple or simpler. Any idea?
>
> It looks like the TGA pixel reading loops need to be unrolled so that there
> is a special case for each permutation and the loops are tight, with very
> little conditional logic.
>
> The code is implemented in the classic ImageMagick style which layers
> conditional code in loops and it looks like I never re-wrote it.
>
> Since you seem to be a capable developer are you willing to try your hand at
> that?
>
> Bob
> --
> Bob Friesenhahn
> [email protected], http://www.simplesystems.org/users/bfriesen/
> GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/
>
>
> _______________________________________________
> Graphicsmagick-help mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/graphicsmagick-help

I'll look into it, shouldn't be too hard. Another question (a bit unrelated):
the code I attached doesn't seem to like pipes, do you know why? Strace show
some lseek failing at some point, but that's all I got.

> ~/gmdecode - <wallpaper.png
0.0399
> cat wallpaper.png | ~/gmdecode -
0.0006
Magick: Improper image header ().