Race-to-Sleep Only Wins Inside the Voltage Band

Ada re-derives this chapter’s own numbers step by step, at full precision

foundations
math-foundations
calculation-audit
energy-power
Ada ADA · CALCULATION AUDIT

Race-to-Sleep Only Wins Inside the Voltage Band

Running a fixed 8-million-cycle task faster draws more current but finishes sooner, so at constant voltage clocking up from 16 to 48 MHz cuts energy by about 30% — the fixed 2 mA awake overhead is simply paid for less time. But reaching the top clock can force the core voltage from 1.0 up to 1.3 V, and dynamic energy scales with voltage squared. This audit rebuilds both ledgers to find where race-to-sleep stops paying: does the faster clock still win once that voltage step is counted?

Companion to the chapter Measure-First Optimization — every number here comes from that chapter.

Ada: The chapter makes two numeric claims that pull in opposite directions — that racing an 8-Mcycle task from 16 to 48 MHz saves about 30% energy, and that raising the core voltage to reach the higher clock can erase that saving. Both hinge on splitting the energy into a dynamic part and a fixed-overhead part, so let me rebuild them from the chapter’s own model (k = 0.15 mA/MHz, 2 mA awake overhead, 8,000,000 cycles).

  • At 16 MHz: run time 8e6 / 16e6 = 0.500 s; current 0.15 x 16 + 2 = 4.4 mA; energy 4.4 x 0.500 = 2.20 mA-s.
  • At 48 MHz: run time 8e6 / 48e6 = 0.16667 s; current 0.15 x 48 + 2 = 9.2 mA; energy 9.2 x 0.16667 = 1.5333 mA-s.
  • Saving: (2.20 - 1.5333) / 2.20 = 30.3% — because the dynamic charge is 1.2 mA-s at either clock (frequency cancels), while the fixed 2 mA overhead falls from 2 x 0.500 = 1.00 mA-s to 2 x 0.16667 = 0.333 mA-s.
  • Now raise the core from 1.0 V to 1.3 V to reach 48 MHz. Dynamic energy scales with voltage squared: 1.3^2 = 1.69, so 1.2 x 1.69 = 2.028 mA-s. Add the shorter-run fixed overhead: 2.028 + 0.333 = 2.36 mA-s.

The audit confirms the reversal exactly: at constant voltage the fast clock wins by 30% (1.53 versus 2.20 mA-s), but the 30% voltage step pushes it to 2.36 mA-s — now worse than the 2.20 mA-s slow baseline. That is why the energy-optimal clock is usually a middle value: race to the top of the constant-voltage band, then stop, because the square-law voltage penalty overtakes the linear time saving the moment more speed starts costing volts.

Every number above is taken from the chapter’s own material and re-derived step by step.