Of course it is possible to optimise a program using another program, after all that is what optimising compilers do. One of my compilers makes dramatic differences to code size and execution speed, just by enabling its optimisation. Interestingly butchering code in a vain attempt to make it “optimal” can often make it worse because it gets in the way of the optimiser.
I have seen someone who wrote X + X + X because it was quote – “faster than 3 * X” – he was amazed at just how much slower his “optimised” and less clear equation was.
I say don’t optimise unless you need to and then try to think of a better algorithm don’t go in for coding tricks.
I have seen someone who wrote X + X + X because it was quote – “faster than 3 * X” – he was amazed at just how much slower his “optimised” and less clear equation was.
I say don’t optimise unless you need to and then try to think of a better algorithm don’t go in for coding tricks.