foomatic-rip extremely slow on focal for PostScript input files - may affect printing

Bug #1869902 reported by Thomas
6
This bug affects 1 person
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+0-0ubuntu0.18.04.12 on bionic:

> 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.

Tags: focal
Thomas (lostexception)
tags: added: focal
Revision history for this message
Alex Cherepanov (alexcher-gs) wrote :

Please attach a sample file. Testing of a few random PS files does not reproduce the described effect.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.