> Interestingly, this was a case in which a little "premature 
> optimization" (using a counter to avoid a system call) would have saved 
> me two weeks of headaches.

Premature optimization is the root of all evil -- Donald Knuth

It might have, in this case, yes.