Documentation
¶
Overview ¶
Command framebench is a frame-time benchmark harness for the dirty-region partial-repaint optimization (pre-rebrand issue #9). The GL/WebGPU paint path cannot be exercised by the software-painter golden suite, so the optimization can only be measured on a real GPU. This harness builds a deliberately heavy, mostly static scene and then drives one deterministic update workload at a fixed cadence, so the same binary built with and without the nopartialrepaint tag (partial repaint is on by default on desktop, #496) can be compared apples-to-apples.
Measurement is done by the driver's BELLUI_FRAME_DEBUG profiler (internal/driver /glfw/frametime.go), which this harness enables. Run one workload per process so the profiler's shutdown flush reports the whole run as a single sample set:
# build both variants go build -tags nopartialrepaint -o /tmp/framebench.full ./cmd/framebench go build -o /tmp/framebench.partial ./cmd/framebench # compare the localized-update case (the one partial repaint should win) /tmp/framebench.full -workload spot /tmp/framebench.partial -workload spot # and the whole-canvas case (partial should gracefully match full) /tmp/framebench.full -workload full /tmp/framebench.partial -workload full
Workloads:
spot — toggle a single small label in one corner each frame. Only a tiny
region changes, so partial repaint should clear+redraw far less.
full — Refresh the whole content tree each frame. The dirty region covers
the canvas, so partial repaint falls back to a full clear; this
workload checks the optimization adds no regression in the worst case.
scroll — scroll a long list by one row each frame (a realistic medium case).