From Ludovic.Desroches at microchip.com Fri Jun 4 07:08:29 2021 From: Ludovic.Desroches at microchip.com (Ludovic.Desroches at microchip.com) Date: Fri, 4 Jun 2021 07:08:29 +0000 Subject: [Pixman] Performance regression with pixman 0.40 Message-ID: <20210604070828.ksthvezswlllxbtm@sekiro> Hi, We are developping a graphics framework called EGT dedicated to Microchip parts: https://github.com/linux4sam/egt We are using Cairo, and so Pixman, for the drawing part. Updating our distribution, we noticed a performance decrease in our benchmark suite, in the worst case our fps decrease from 200 to 60. We have identified the move from Pixman 0.38.4 to 0.40 as the cause. I did a bisect to find which commit impacts us and it's this one: commit 6fe0131394fb029d2fccaee6b8edcb108840ad8a (refs/bisect/bad) Author: Federico Mena Quintero Date: Wed Mar 18 18:49:30 2020 -0600 Initialize temporary buffers in general_composite_rect() Otherwise, Valgrind shows things like "conditional jump or move depends on uninitialised values" errors much later in calling code. For example, see https://gitlab.gnome.org/GNOME/librsvg/issues/572 Fixes https://gitlab.freedesktop.org/pixman/pixman/issues/9 diff --git a/pixman/pixman-general.c b/pixman/pixman-general.c index 7d74f98..7e5a0d0 100644 --- a/pixman/pixman-general.c +++ b/pixman/pixman-general.c @@ -165,6 +165,12 @@ general_composite_rect (pixman_implementation_t *imp, if (!scanline_buffer) return; + + memset (scanline_buffer, 0, width * Bpp * 3 + 15 * 3); + } + else + { + memset (stack_scanline_buffer, 0, sizeof (stack_scanline_buffer)); } src_buffer = ALIGN (scanline_buffer); I don't know which drawing paths are impacted by this change, I can dig further if needed. We have 2 benches with small performance decrease for all our devices: armv5 and armv7. And one bench with huge performance decrease on our armv5 device. This bench is about drawing circles with alpha blending. Other benches which draw squares, squares with alpha blending, and circles are not impacted. For sure, having an extra memset in the path can explain the performance decrease. Do we have to consider that the new scores we get are the valid ones or can we find an alternative? Thanks Regards, Ludovic From mattst88 at gmail.com Tue Jun 15 18:17:48 2021 From: mattst88 at gmail.com (Matt Turner) Date: Tue, 15 Jun 2021 11:17:48 -0700 Subject: [Pixman] Performance regression with pixman 0.40 In-Reply-To: <20210604070828.ksthvezswlllxbtm@sekiro> References: <20210604070828.ksthvezswlllxbtm@sekiro> Message-ID: Cc'ing the patch author, since I don't think he's subscribed. On Fri, Jun 4, 2021 at 12:15 AM wrote: > > Hi, > > We are developping a graphics framework called EGT dedicated to Microchip parts: > https://github.com/linux4sam/egt > > We are using Cairo, and so Pixman, for the drawing part. Updating our > distribution, we noticed a performance decrease in our benchmark suite, in > the worst case our fps decrease from 200 to 60. > > We have identified the move from Pixman 0.38.4 to 0.40 as the cause. I did a > bisect to find which commit impacts us and it's this one: > > commit 6fe0131394fb029d2fccaee6b8edcb108840ad8a (refs/bisect/bad) > Author: Federico Mena Quintero > Date: Wed Mar 18 18:49:30 2020 -0600 > > Initialize temporary buffers in general_composite_rect() > > Otherwise, Valgrind shows things like "conditional jump or move > depends on uninitialised values" errors much later in calling code. > For example, see https://gitlab.gnome.org/GNOME/librsvg/issues/572 > > Fixes https://gitlab.freedesktop.org/pixman/pixman/issues/9 > > diff --git a/pixman/pixman-general.c b/pixman/pixman-general.c > index 7d74f98..7e5a0d0 100644 > --- a/pixman/pixman-general.c > +++ b/pixman/pixman-general.c > @@ -165,6 +165,12 @@ general_composite_rect (pixman_implementation_t *imp, > > if (!scanline_buffer) > return; > + > + memset (scanline_buffer, 0, width * Bpp * 3 + 15 * 3); > + } > + else > + { > + memset (stack_scanline_buffer, 0, sizeof (stack_scanline_buffer)); > } > > src_buffer = ALIGN (scanline_buffer); > > > I don't know which drawing paths are impacted by this change, I can dig further > if needed. We have 2 benches with small performance decrease for all our > devices: armv5 and armv7. And one bench with huge performance decrease on our > armv5 device. This bench is about drawing circles with alpha blending. Other > benches which draw squares, squares with alpha blending, and circles are not > impacted. > > For sure, having an extra memset in the path can explain the performance > decrease. > > Do we have to consider that the new scores we get are the valid ones or can we > find an alternative? > > Thanks > > Regards, > Ludovic > _______________________________________________ > Pixman mailing list > Pixman at lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/pixman