The test case of the bug 689189 defines 79 shadings. While interpreting it Ghostscript calls zbuildshading2 9600+ times. Please reuse the shadings once built.
Change assignment since I work on it.
Patch to HEAD : http://ghostscript.com/pipermail/gs-cvs/2007-May/007580.html