[Mesa-dev] mesa vs pahole

Eero Tamminen eero.t.tamminen at intel.com
Fri Mar 20 02:28:08 PDT 2015


Hi,

On 03/20/2015 09:29 AM, Dave Airlie wrote:
> I started running pahole on stuff today and mesa had a bunch of low
> hanging fruit all over the types, the main thing all of this
> does is reduce the mesa context size considerably.
>
> before:
> /* size: 150024, cachelines: 2345, members: 114 */
> after:
> /* size: 146912, cachelines: 2296, members: 114 */
>
> thats about 3k gone.
>
> but I'm sure some of these are kinda pointless
> micro-optimisation, but maybe give some points
> on where we can focus some reductions,
> gl_texture_attrib
> gl_image_unit
> being two of the scarier things I hit.

Couple of other things one might to do when looking at structures:

* Check from pahole whether members that are most commonly used together 
are on the same cacheline

* Running valgrind --tool=cachegrind and checking from kcachegrind GUI 
whether your use-case has any cache miss hotspots will help in decided 
what things should be in same cacheline

* Checking from "valgrind --tool=exp-dhat" output your (structure) 
allocation utilization and liveness:
	http://valgrind.org/docs/manual/dh-manual.html


	- Eero




More information about the mesa-dev mailing list