I'm on my fourth dog, all have been females. Our current pup was a senior rescue who came to us already spayed, but the other three were all spayed at 6 months or earlier. They lived to 15 1/2 years, 15 1/2 years, and 9 years old. The third died young due to stroking out from steroid treatments for hip dysplasia.
Of all the cats I've owned there was only one I didn't spay, and she had breast cancer by 7. Most of the others lived long lives: 13, 17, 19.
So my experience is that spaying by 6 months worked well, and NOT spaying resulted in an early death.