I remember when a friend and I started optimizing a DES library in C at university in 1990. We had the same dynamics of the post, each other skimming off some cycles even when we thought that one of us got to an unbeatable implementation. We obviously had tests to prove correctness and measure speed. Bizarrely there weren't many tests around in the industry back then. I can't remember when I wrote my first unit test after then.