Created attachment 7292 [details] Example file I'm trying to convert pdf files to images, and I found that some files take a VERY long time. The reason appears to be jpeg2k/jpx decoding. With gs compiled without jpeg2k support, the conversion is almost instant (but misses the image). I'm attaching a sample document. This is what I did and what happened: % time gs -sDEVICE=jpeg -o d.jpg "Document (1).pdf" GPL Ghostscript 9.00 (2010-09-14) Copyright (C) 2010 Artifex Software, Inc. All rights reserved. This software comes with NO WARRANTY: see the file PUBLIC for details. **** Warning: File has a corrupted %%EOF marker, or garbage after %%EOF. Processing pages 1 through 1. Page 1 **** This file had errors that were repaired or ignored. **** The file was produced by: **** >>>> OmniPage CSDK 16 <<<< **** Please notify the author of the software that produced this **** file that it does not conform to Adobe's published PDF **** specification. gs -sDEVICE=jpeg -o d.jpg "Document (1).pdf" 4.49s user 42.65s system 98% cpu 47.621 total This is on a Core(TM)2 Duo CPU E8500 @ 3.16GHz; on a Core(TM)2 Quad CPU Q9300 @ 2.50GHz it took 59 sec. The same file opens quickly (within about 3 seconds) in adobe reader, mupdf and okular.
Alex is this something that will be fixed with the openjpeg integration?
The fact that most of the time was spent as system time indicates that computer is using virtual memory. Ghostscript allocates 630M of memory running the sample file. On my i7 920 the file finishes in 3.5 sec. On an older box the file takes 8 sec of wall time.
With the switch to OpenJPEG, on my core2 quad, the file now takes ~2 seconds, and uses <300Mb of memory. I feel this is fixed. http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=83b1e042
Thanks, what version will this be?
Ghostscript 9.05 - scheduled for release in February 2012.