Rachels Lab Notes

Game Development as seen through the Blum Filter

Archive for the ‘Tool Time’ Category

Structure Padding Analysis Tools

with 3 comments

One issue we always face is the fact that we don’t have enough memory. Ever. And even if we did, we like our data structures small and crunchy for performance reasons.

Sure, we pay attention to it all the time – and yet, occasionally, something slips through. So it’s nice that somebody wrote a tool – Cruncher# – to just load your PDB and examine all your structures for unnecessary padding.

And if you desire to look at ELF files (i.e. you’re under Linux, or working on a certain console), there’s pahole. Not only does it point out padding (or ‘holes in your structure’), it’s also friendly enough to tell you how many cache lines your structure will consume.

Let’s hope the two authors inspire each other!

Written by groby

October 22nd, 2009 at 8:19 am

Posted in Tool Time