After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 125828 - libgnomeprint has serious perfomance hit bug
libgnomeprint has serious perfomance hit bug
Product: gnome-print
Classification: Deprecated
Component: general
Other All
: Normal normal
: ---
Assigned To: Chema Celorio
Chema Celorio
Depends on:
Reported: 2003-10-30 12:09 UTC by Alexander Nedotsukov
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---

Proposed patch (325 bytes, patch)
2003-10-30 12:10 UTC, Alexander Nedotsukov
none Details | Review

Description Alexander Nedotsukov 2003-10-30 12:09:09 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.
Comment 1 Alexander Nedotsukov 2003-10-30 12:10:13 UTC
Created attachment 21055 [details] [review]
Proposed patch
Comment 2 Andreas J. Guelzow 2003-10-30 14:01:02 UTC
cc-ing Jody since this patch looks reasonably.
Comment 3 Jody Goldberg 2003-11-03 16:41:17 UTC
Good idea.