Function Re-Ordering (Software Engineering)
Well, this is not one of my favorite concepts but I came across a really interesting (and old but that’s irrelevant) thread from Linux kernel developers. It seems like function reordering works. Of course, everyone should be expecting this when you have projects like operating system’s kernel which is composed by million lines of code. Jumps through different code paths can be more efficient if they’ve implemented with short jumps which means that functions are close to each other in the machine code. Even though modern processors provide features such as branch prediction I still believe it’s a good software engineering practice to order your functions according to their use.