News for hackers. Stuff that matters.
Re:How misaligning data can increase performance 12x by redu... by mtanski on Friday January 03, 2014 @10:03AM (#7005710)
In C / C++ (in POD structs) you can use the pack attribute. Here's more documentation: http://gcc.gnu.org/onlinedocs/gcc/Type-Attributes.html I would still recommend you try to lay out the struct by hand to try to the right alignment for the variable.

Having said all that, before you do this. Why don't you first measure where you're seeing high cache misses and only optimize those. On Linux the perf tool is a god send, you can annotate down to the source code line.

There are no comments on this comment yet.