You need ANOTHER program; one that will randomly change some bits in the one you are wondering about, and we'll wait for a more efficient one to show up.
In this memory hungry world we live in, resources are stretched thin. A meaner, leaner code would DEFINITELY have an advantage over slower, more convoluted stuff that will probably overflow its stack at some point in the future anyway.
The difference is that while the majority of mutations may happen to be damaging to an individual, once in a while a mutation may pop up that is helpful.
You just need a large enough population for "mutation fodder" so that the whole group doesn't die out first.
Oh yes, and stable enough conditions so that mutation remains useful or advantageous and thus will be likely to spread--no use evolving extra-large gills just in time for your lake to evaporate in a drought :-)
Oh yes, and lack of inconvenient massive environmental changes of other types which obviate your survival adaptations towards other environmental factors--the Ankylosaur or (was it Edmontonia?) had great armor for protecting against predators, but the armor probably wouldn't help much against Iridium-rich meteors.
Or in the case of computers, a porn-spewing virus which takes over your hard drive... Cheers!