foomatic-rip extremely slow on focal for PostScript input files - may affect printing
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cups-filters (Ubuntu) |
New
|
Undecided
|
Unassigned | ||
ghostscript (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
"ghostscript -sDEVICE=bbox" is used to compute the "BoundingBox" of an input file. On focal with ghostscript 9.50~dfsg-5ubuntu3 this is extremely slow for PostScript files (~factor 6 compared to bionic). This may affect printing as e.g. foomatic-rip is using this approach when rendering such a file.
Example with a simple (one page) PostScript test page:
ghostscript 9.50 on focal:
> time gs -q -dNOPAUSE -dBATCH -sDEVICE=bbox testprint.ps
real 0m16,493s
> time gs -q -dNOPAUSE -dBATCH -sDEVICE=bbox -r4000 testprint.ps
real 0m17,071s
> time gs -q -dNOPAUSE -dBATCH -sDEVICE=bbox -r1200 testprint.ps
real 0m0,980s
ghostscript 9.26~dfsg+
> time gs -q -dNOPAUSE -dBATCH -sDEVICE=bbox testprint.ps
real 0m2,697s
> time gs -q -dNOPAUSE -dBATCH -sDEVICE=bbox -r4000 testprint.ps
real 0m2,604s
> time gs -q -dNOPAUSE -dBATCH -sDEVICE=bbox -r1200 testprint.ps
real 0m1,029s
As one can see, the default resolution for computing the BoundingBox is 4000dpi. While on bionic the time is basically linear, on focal this takes much longer. Surprisingly for PDF this is no problem at all.
I'm not an expert for ghostscript internals, but by strace-ing the beast it seems that 9.26 mallocs a 300MB memory area while 9.50 only allocates at max ~30MB. Maybe this is a problem with internal memory management when the rendered page doesn't fit in the allocated area at high resolutions?
Obviously I don't know if this is an upstream bug or a problem with the Ubuntu build.
Please attach a sample file. Testing of a few random PS files does not reproduce the described effect.