You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Measure what the day ribbon's shader actually costs #111
docs/ says it plainly and has said it since #76: «What it costs is unmeasured too — one shader layer and a per-frame clock on a mid-range phone is a frame budget nobody has looked at.»
The ribbon has three depth levels — AGSL shaders on API 33+, gradients on 31–32, a flat fallback below — and RibbonDepthLevelTest proves which level a given API gets. It cannot prove that the chosen level is affordable.
The ladder, cheapest first:
adb shell dumpsys gfxinfo com.lumenpearson.lessons framestats while scrolling the ribbon. Zero setup, 120 frames of nanosecond columns.
A Perfetto trace, read with trace_processor_shell and SQL. Add androidx.tracing:tracing-perfetto and the trace names the composable that recomposed.
Macrobenchmark with FrameTimingMetric for a number that survives a rerun — see the separate issue for the module, and note it needs a non-debuggable build or the numbers are wrong by a multiple.
What would count as an answer: the three depth levels compared on the same device and the same scroll, with frameOverrunMs P90 for each. If the shader level is not affordable on the phones this is for, the honest fix is to lower the API threshold rather than to keep a level nobody can run.
Do not measure this on an emulator alone. The GPU is emulated; the comparison between levels is meaningful, the absolute numbers are not.
Relative numbers from an emulator (AVD Pixel_10_Pro_XL, API 37 (google_apis_playstore, x86_64, 1344×2992 at 480 dpi), 26–27 September 2026). Twelve flings of Monday's ribbon, read with dumpsys gfxinfo:
build
SHADER p50
NONE p50
debug
200 ms
250 ms
release (bd7c816, from the APK workflow)
150 ms
200 ms
The system Settings app, scrolled the same way on the same emulator, came out at p50 150 ms with 88 % of frames janky, so these numbers are this emulator's floor rather than the ribbon's cost. Within it the shader adds nothing measurable. With no lesson running the ribbon draws one frame in ten seconds, so nothing redraws per frame when idle.
Left open for a phone, where the absolute numbers mean something.
Activity
lumenpearson commentedon Sep 26, 2026
Relative numbers from an emulator (AVD
Pixel_10_Pro_XL, API 37 (google_apis_playstore, x86_64, 1344×2992 at 480 dpi), 26–27 September 2026). Twelve flings of Monday's ribbon, read withdumpsys gfxinfo:bd7c816, from the APK workflow)The system Settings app, scrolled the same way on the same emulator, came out at p50 150 ms with 88 % of frames janky, so these numbers are this emulator's floor rather than the ribbon's cost. Within it the shader adds nothing measurable. With no lesson running the ribbon draws one frame in ten seconds, so nothing redraws per frame when idle.
Left open for a phone, where the absolute numbers mean something.