struct foo {
struct bar *bar;
struct baz *baz;
}
into struct foo {
struct bar bar;
struct baz baz;
}
Of course, this is not always possible - but a C program written naively/for encapsulation/flexibly tends to have a lot of places where you can perform such an optimization.The performance win, on modern platforms, comes chiefly from reducing the number of (unpredictable/non-cached) pointer dereferences.