I received a file (confidential) that has an image with a 1 component DeviceN colorspace that maps (through a long type 4 function) to a CMYK colorspace. Rendering takes over 20 minutes. The reason is that for each pixel, first the type 4 (PostScript) function must be calculated, then the CMYK value must be converted to RGB.
Solution: cache the inputs and the results when the DeviceN colorspace has only 1 component. Rendering time goes down to a few seconds.