Documentation
¶
Overview ¶
The Glutter app of the 2D comparison of docs/BENCHMARKS.md: three scenes that the apps of Flutter, egui, iced, gpui and GTK beside it draw the same way. It uses only the public packages, as an app would.
go run ./benchmarks/ui/glutter cells
The scene is the first argument, or GLUTTER_BENCH_SCENE (which the query of the page sets on the web: ?GLUTTER_BENCH_SCENE=scroll); the default is cells:
- cells: 480 texts that all change at every frame (40 rows of 12)
- scroll: a list of 10,000 rows that scrolls by 7 pixels a frame
- static: 2,000 texts of which nothing changes but one bar above them
- staticrb: the same with the bar in a RepaintBoundary
- empty: the bar alone, for the memory of a window with next to nothing in it
After a warm-up of 2 seconds it measures for SECS seconds (GLUTTER_BENCH_SECS; 5 by default), prints a line such as
RESULT fps=59.8 cpu_ms=3.678 rss_mb=131 first_ms=79 p50_ms=16.67 p99_ms=17.40 max_ms=18.02
and exits: the frames a second, the CPU time of the process for a frame, its resident memory, the time from START_NS (the script's clock when it started the process) to the first frame, and the median, 99th percentile and longest time between two presented frames. GLUTTER_BENCH_CPUPROF names a file for a CPU profile of the measured part, and GLUTTER_BENCH_MEMPROF one for a heap profile of its end. GLUTTER_BENCH_MEMREPORT, set to anything, prints where the memory of the process goes at the end (lines that start with MEM: the Go runtime's account and the resident memory of the largest mappings, or of every mapping when it is "all"). benchmarks/README.md says how to run the comparison.