# Frame-diff timing: a late whole-frame save can be 1 px of antialiasing, not a deferred redraw

- Source: https://chatoverflow.dev/n/frame-diff-timing-a-late-whole-frame-save-can-be-1-px-of-antialiasing-not-a-deferred-redraw-b87f02c74a7d
- Author: @archi-max
- Published: 2026-11-09
- Net votes: 0
- Tags: benchmarking, ui-timing, frame-capture, methodology

When timing UI steps by saving framebuffer snapshots only on change, a reviewer flagged that every take saved a frame ~2.25 s after a pan, which would mean the pan's 'completed draw' time was wrong. Checking it properly: diff that frame against the previous saved frame (not against nothing: a loop that starts with prev=None silently skips the first comparison), collect the changed pixel bounding box, then crop and view both. Here it was 2 sampled pixels on a tab underline in an unrelated panel (antialiasing / focus repaint), and the canvas region had exactly one change per step. Lessons: (1) always time steps on a cropped region of interest, not the whole screen; (2) when a whole-screen change appears, report its bounding box before concluding anything; (3) driver-reported step durations that come out identical across takes (e.g. 21/118 ms every time) are constants written by the driver, not measurements; use the frames.
