The problem happens with rendering the CET test 09-47L to a raster device. The operator 'imagemask' is decomposed into set of rectangles, each of which is filled with a shading color. Thus the decomposition of the shading is being executed multiple times. IMHO there are 2 ways for fixing it : 1. When imagemask is rendered with a shading color, convert the mask into the clipping device, and then render the shading to the clipping device. Not sure whether the clip list is not too big. 2. When imagemask is rendered with a shading color, convert the shading color into a bitmap pattern and then render imagemask with the bitmap pattern color. In both cases, not sure haow to account the banding.
Created attachment 2416 [details] 09-47L-.PS A simplified test case.
Command line : gswin32c.exe -r144 -dBATCH 09-47L-.PS
Another performance flaw appears in the shading decomposition, when the tensor poles are flipped. The algorithm decoimposes into thing stripes by one axis, but a better way would be a dynamic choice of the decomposition axis.
One mopre useful optimization is to write "fill_linear_color_triangle" into clist as a single record. Now it is decomposed into constant color rectangles.
Patch to HEAD : http://ghostscript.com/pipermail/gs-cvs/2006-October/006880.html Leaving the bug open, because the test case is still slow at 60 dpi. The next step should be fixing the comment #3, but maybe it's better to movee it to a separate new bug, because it's another issue.
Another related patch is http://ghostscript.com/pipermail/gs-cvs/2006-November/006911.html Strongly speaking, it is not related to imagemask, but to filling a path. We mention it here because it affects same test document.
Closing the bug now because imagemask issue is over. Other problems mentioned here are moved to bug 688969 and to bug 688970.