??? 08/02/06 19:34 Read: times |
#121589 - depends on what you define as overhead Responding to: ???'s previous message |
if you consider one simple example ... a loop to sample a port bit at a precise rate. At some speeds it is simple, as you can easily execute plenty of loops testing a status bit, OR, you have to "straight-line" a loop in which you sample the bit, say, 32 times before branching back because 32 passes through the loop allows you to recover enough time to mask the time loss due to the branch.
Some would consider that an optimization, while some would consider the extra code volume to be extra overhead. I personally consider the test and branch if set operation overhead, but I can certainly see why one might consider the extra code to be overhead as well. Most people don't bother to write critically timed code at all, preferring to use one form or another of hardware to solve the problem. As I see it, however, if I have to make nine passes one time and ten passes every tenth time, then the logic to determine which time "this" is fits into the overhead category in my judgment. I don't see how any sort of tool can perform that optimization for me. RE |