Stefan Esser, well know PHP programmer and analyst says:
http://www.suspekt.org/switchtable/

This also means that the execution speed of a PHP switch() statement can be increased by sorting the more likely cases to the front.

I wonder - is it worth to search Drupal for these cases and alter them to save some jumps? It's just a matter of a way to search, use some debugger or try to determine slower switch statements based on empirical observations?

First case may be node_help() where node/%/edit is always evaluated last.

Comments

damien tournoud’s picture

I tend to thing this is probably not our biggest concern, performance-wise.

Anonymous’s picture

Status: Active » Closed (won't fix)

I've thought about this issue since you posted it. I come to the same conclusion as Damien; besides, you have a maintenance nightmare trying to decide the best path every time there is a patch.