1. A cardiac rhythm management system comprising: a pulse output circuit to deliver electrical stimulation pulses; a sensing circuit to sense a cardiac signal; a heart rate variability (HRV) measurement circuit, coupled to the sensing circuit, to measure a variance in cardiac cycle lengths over a predetermined period of time based on the sensed cardiac signal and to produce an HRV parameter being a measure of the variance; and a stimulation control circuit, coupled to the pulse output circuit, the sensing circuit, and the HRV measurement circuit, the stimulation control circuit including a stimulation parameter optimization module adapted to adjust at least one stimulation parameter to an approximately optimal value based on the HRV parameter, the stimulation parameter optimization module including: a stimulation parameter generator adapted to produce a plurality of test values for the at least one stimulation parameter to be tested during a stimulation parameter optimization period, the stimulation parameter generator including a physiologic parameter measurement module adapted to measure at least one physiologic parameter and a dynamic stimulation parameter generator adapted to dynamically produce the plurality of test values during the stimulation parameter optimization period using the at least one physiologic parameter; a pulse output controller adapted to control delivery of a plurality of series of test pulses of the electrical stimulation pulses using the at least one stimulation parameter during the stimulation parameter optimization period, each series of test pulses of the plurality of series of test pulses associated with a test value of the plurality of test values for the at least one stimulation parameter; a stimulation parameter selector adapted to select the approximately optimal value for the at least one stimulation parameter from the plurality of test values, the approximately optimal parameter value associated with a maximum variance in cardiac cycle lengths measured for the stimulation parameter optimization period and indicated by the HRV parameter; and an optimization timer adapted to start and stop the stimulation parameter optimization period.