docs(sidebar): record how long a rebuild takes #27
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "t3code/plan-issue-17"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Resolves the measuring half of #17.
rebuild_sidebarhad never been timed. It has now been, on a release build, with a generated tree.The design holds at the sizes it was chosen for and stops holding at about sixty sessions, where one rebuild no longer fits in a 60 Hz frame.
Widget construction is the whole cost. Of the 152.6 ms at five hundred sessions,
Store::layoutand the per-row settings reads are 1.7 ms — 1%. Sections are expensive too: the same five hundred sessions in one section instead of twenty cost 83 ms rather than 153 ms. The renderer barely matters, which is what you would expect if the time goes on building widgets rather than drawing them.The periodic path is what makes it visible. With five hundred sessions and twenty of them running something whose foreground program keeps changing, the sidebar rebuilds ~6.8 times a second at ~149 ms each — about one second of main-thread work for every second there is, so the window stops drawing. The same test at fifty sessions with ten busy is 4.8 rebuilds a second at 8.1 ms, ~4% of the main thread, and fine.
What is in here
crates/terminalko-config/examples/gen-tree.rs— generates the tree. It erases the existing one, so it refuses to run unlessGSETTINGS_BACKENDiskeyfileormemory.docs/spec/session-sidebar.md— the numbers, in the "Edge cases" section.The timing instrumentation itself is not in this branch: three
Instants behind aTK_TIME_SIDEBARenv var, kept local, since the numbers are the deliverable and not the scaffolding.Not in here
No optimisation. #17 asked for a measurement first, and the measurement says the fix is #1's
GtkListViewover aGListStore— which builds widgets only for visible rows and can update them in place — not a second mechanism built here. #17 stays open until #1 lands.Method, for anyone reproducing it
Release build,
GSETTINGS_BACKEND=keyfilein a throwawayXDG_CONFIG_HOME, a private D-Bus session, GL renderer unless stated. Rebuilds driven by alternatingsession-colourover D-Bus so the tree size stays constant; median of ~30 samples, warm-up discarded. The busy sessions runbash -i -c 'while :; do sleep 0.4; timeout 0.4 sleep 9; done'— an interactive shell because without job control the children never leave the shell's process group andtcgetpgrpkeeps naming the shell, so the foreground program never appears to change../build-aux/ci.shand./build-aux/smoke.shboth pass.