Grumpy mike, please take note about the time critical code part in regards to the trial&error approach
If things are really time critical, you compile to the assembler level (or decompile the object code), pull out your microprocessor data sheet, and start counting cycles.