From 71e3dd8a8b57a443d28440a26ccdab24c0f1267d Mon Sep 17 00:00:00 2001 From: Jakub <106778416+MarekZegare4@users.noreply.github.com> Date: Thu, 1 Oct 2026 20:56:14 +0200 Subject: [PATCH] perf(l2): Nodes slides in smoothly, Diagnostics opens in half the time Rows still to build wait while a screen slides in, so its frames aren't a fill budget apart (Nodes: 12 frames of 24 ms instead of 7 of 33, up to 65). The crash dump in flash is read at boot, not on the first Diagnostics (build 54 -> 20 ms). The perf tools time Nodes too. Co-Authored-By: Claude Opus 5.5 --- examples/companion_radio/ui-lvgl/UITask.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/companion_radio/ui-lvgl/UITask.cpp b/examples/companion_radio/ui-lvgl/UITask.cpp index 2ce5b14f..682e98f0 100644 --- a/examples/companion_radio/ui-lvgl/UITask.cpp +++ b/examples/companion_radio/ui-lvgl/UITask.cpp @@ -1310,6 +1310,7 @@ void UITask::begin(DisplayDriver* display_drv, SensorManager* sensors, NodePrefs buildStatusBar(); applyDisplayPrefs(); // a slider percentage overrides the level main.cpp set + { char c[24]; lvport::crashSummary(c, sizeof(c)); } // the dump in flash read now (~45 ms), not on the first Diagnostics showHome(); if (pinSet()) lockScreen(); // a reboot doesn't get round the PIN showSplash(); // over both; fades out by itself @@ -1756,7 +1757,7 @@ void UITask::loop() { if (lv_obj_get_style_layout(o, LV_PART_MAIN) == LV_LAYOUT_FLEX) ++*(uint32_t*)u; return LV_OBJ_TREE_WALK_NEXT; }, &nf); Serial.printf("PERF flex containers %lu\n", (unsigned long)nf); - if ((!fn && (page == 7 || page == 1)) || fn == &UITask::showContacts) { + if ((!fn && (page == 7 || page == 1)) || fn == &UITask::showContacts || fn == &UITask::showNearby) { char tag[12]; snprintf(tag, sizeof(tag), "%s%d", fn ? "list" : "page", page); fillFlush(); // the whole page, not only its first section perfDrawProfile(tag); @@ -1777,6 +1778,7 @@ void UITask::loop() { one("admin", 0, &UITask::showAdminPick); one("contacts", 0, &UITask::showContacts); one("chats", 0, &UITask::showChats); + one("nearby", 0, &UITask::showNearby); #ifdef PERF_CONTROLS { // -D PERF_CONTROLS: every control on the settings screens used once (perfControls) auto ctls = [this](const char* tag, int page, void (UITask::*fn)()) { @@ -2501,6 +2503,9 @@ void UITask::fillStep() { } void UITask::fillTick() { + // Not while the screen moves in: its frames came a budget apart (Nodes, + // 57 rows: 33 ms a frame, up to 65). What it shows first is built already. + if (!s_fill_n || (_body && lv_anim_get(_body, NULL)) || lv_display_get_screen_prev(NULL)) return; uint32_t t0 = micros(); while (s_fill_n) { fillStep();