import { FIGURES } from '../../data/figures'; import { REPO } from '../../data/site'; import styles from './FrameBudget.module.css'; import { FX } from './fx'; import { useLoop } from './hooks'; import { SectionHeader } from './SectionHeader'; import ui from './ui.module.css'; // 30 frames of 16.7 ms at 40x slow motion; a key lands every 9th frame, about every 150 ms. const TRAIN = Array.from({ length: 60 }, (_, i) => i % 9 === 3); export function FrameBudget() { const train = useLoop(FX.train); return (
one frame at 60 Hz 16.7 ms
3 ms
13.7 ms left over
work per keystroke · 10,000 line file · iOS, debug build · median of 60 keys
Frames go by. A key lands every 150 ms, as in the benchmark. slowed down 40×
{TRAIN.map((key, i) => ( // biome-ignore lint/suspicious/noArrayIndexKey: frames are positional
{key && ( <>
key )}
))}
{FIGURES.map((figure, i) => { const [amount, unit] = figure.value.split(' '); return (
{amount} {unit}
{figure.label}
{figure.where.replace(/^on /, '')}
); })}

Simulator and emulator numbers, re-measured before each release to catch regressions. Numbers from a real device are welcome in an issue.

); }