GNOME Bugzilla – Bug 125828
libgnomeprint has serious perfomance hit bug
Last modified: 2004-12-22 21:47:04 UTC
In fact this is all about libgnomeprint 2.4.0 Raster image printing for metafile has let's call it performance bug. Look at src/gnome-print-meta.c:meta_image ... for (y = 0; y < h; y++){ gpm_encode_block (pc, px, w * ch); px += rowstride; } ... This pice of code works fine for small images. But if we going to print something like digital photo wich is usualy around 2Mb (and this is a packed size so real raw image buffer will be much bigger) size and about a 1.5K lines in height gpm_encode_block will stress system with 1.5K g_reallocs() for underlying metafile buffer wich will start from ~10K and finish with ~megs of raw image size. Proposed fix will be just prealloc image size before image encoding. See patch attached.
Created attachment 21055 [details] [review] Proposed patch
cc-ing Jody since this patch looks reasonably.
Good idea. Applied.