Well, these 3 classes have no business being in the header (as they are in truth only ever used in this cpp, and do not need exporting to the rest of the world). If they are put in the .cpp, the compiler gets less of a chance to say "Hey, these things might be used anywhere, lets be carefull about inlining these), and more of a chance to say "Wow, these are only ever used here, lets inline and unroll like crazy".