[Glamor] [Patch 00/01] Move realloc out of diagonal line drawing loop.

Grigori Goronzy greg at chown.ath.cx
Wed Mar 26 03:14:27 PDT 2014


On 25.03.2014 22:02, Conn Clark wrote:
> The number of line segments in drawing the diagonal line can be
> calculated. This means we can move two operations out of the loop, the
> realloc and the adjustment to the final count.
>
> This shaves 3 to 5 seconds off of gtkperf line benchmark that takes 388
> seconds on my machine (About a 1% improvement ) .  I have more
> optimizations but that can shave a total of 20 but they are ugly at the
> moment and I'll submit them later.
>

AFAICT the real bottleneck with line drawing is the lack of batching - 
each line, and in case of diagonal lines each line segment, is rendered 
with a single draw call each. That has a huge overhead. I haven't tested 
this, but I can imagine you'll easily see multiple orders of magnitude 
speed ups with proper batching.

No idea if this has been improved in the xserver-based glamor yet.

Best regards
Grigori


More information about the Glamor mailing list