[Mesa-dev] [PATCH] st/mesa: In update_samplers(), clear all samplers at once.

Henri Verbeet hverbeet at gmail.com
Wed Mar 23 12:23:47 PDT 2011

On 23 March 2011 19:29, Keith Whitwell <keithw at vmware.com> wrote:
> If you don't do that, I wonder if there is really a gain here -- it
> might be that the original memset was inlined (because it has a known
> size) and the new version just converts that to a non-inlined memset
> with an unknown size?
> As it stands, I don't see why this generates such a big improvement.
I'm not sure how big of an improvement that ~3% actually is, I guess
it depends on how much time is actually spent in update_samplers().
The decrease in total CPU time, or perhaps frame time is probably more
meaningful. However, I could imagine that clearing an obviously
contiguous block of memory might be somewhat friendlier on the cache
than interleaving it with various other memory accesses. That's
without having seen the actual code the compiler produces though. On
the other hand, does it need to be cleared at all? It looks like most
of the fields are overwritten anyway if the sampler is actually used.

More information about the mesa-dev mailing list