  We investigate the performance of an underdamped stochastic heat engine for a
time-dependent harmonic oscillator. We analytically determine the optimal
protocol that maximizes the efficiency at fixed power. The maximum efficiency
reduces to the Curzon-Ahlborn formula at maximum power and the Carnot formula
at zero power. We further establish that the efficiency at maximum power is
universally given by the Curzon-Ahlborn efficiency in the weakly damped regime.
Finally, we show that even small deviations from operation at maximum power may
result in a significantly increased efficiency.
