Using a combination of a power meter, a trainer, a heart rate monitor, maybe a pulse/ox, and a computer for data collection and analysis... You could theoretically setup test parameters and see what cadence results in the best output w/ the least impact over the longest period of time. Not easy or convenient. Most common is lots of riding on varied road conditions at different cadences to "feel" what is best. Using some of the tools like an HRM should help you match "feel" with more tangible data to decide...