[Mesa-dev] [PATCH 2/2] i965: Optimize intel_batchbuffer_emit_dword().

Chris Wilson chris at chris-wilson.co.uk
Wed Jul 8 14:07:11 PDT 2015


On Wed, Jul 08, 2015 at 02:00:02PM -0700, Matt Turner wrote:
> By keeping a pointer to the next available location, we reduce the
> number of memory accesses needed to write to the batchbuffer.
> 
> A net ~7k reduction of .text size, 7.5k of which is from the change to
> intel_batchbuffer_emit_dword().
> 
>    text     data      bss      dec      hex  filename
> 4943740   195152    26192  5165084   4ed01c  i965_dri.so before
> 4936804   195152    26192  5158148   4eb504  i965_dri.so after
> 
> Combined with the previous patch, improves performance of Synmark
> OglBatch7 by 4.05914% +/- 1.49373% (n=270) on Haswell.
> ---
> Full disclosure: when testing on an IVB desktop, I measured a
> regression in the same benchmark of -4.19005% +/- 1.15188% (n=30).
> I don't have any explanation.

The problem is that it seems to generate worse code with multiple
adjacent emit_dwords. I have seen similar regressions when doing the
same batch[index] to *batch++ elsewhere.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the mesa-dev mailing list