You can say that about any code at all, so no optimising would ever be possible. The program running faster is a side effect after all.