xorl %eax, %eax

Function Re-Ordering (Software Engineering)

leave a comment »

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.

Written by xorl

March 11, 2009 at 15:22

Posted in C programming

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s