A balanced diet rich in carbohydrates, proteins, and fats provides the energy needed for training and recovery, which can indirectly improve swimming speed.