mirror of
https://github.com/torlando-tech/pyxis.git
synced 2026-09-25 14:13:36 +00:00
chore(messages): remove temporary [PERF] instrumentation
On-device capture confirmed the fix (cold-boot tap: fallbacks=0, gather=2ms, total=48ms vs 2086ms pre-fix; repeat taps no longer perpetually fall back). All [PERF] timing markers and stage variables are removed from refresh()/show()/render_route; the branch is now clean of diagnostic code.
This commit is contained in:
@@ -198,13 +198,6 @@ void ConversationListScreen::refresh() {
|
||||
return;
|
||||
}
|
||||
|
||||
// [PERF] temporary instrumentation — removable. Stage timings for the
|
||||
// Messages tap path. Kept as INFO so it survives a DEBUG-off build and
|
||||
// lands in the serial capture.
|
||||
const uint32_t p_t0 = millis();
|
||||
uint32_t p_t_gather = 0, p_t_diff = 0, p_t_rebuild = 0;
|
||||
size_t p_fallbacks = 0;
|
||||
|
||||
// Revalidate-then-render: gather the row data first (now O(1) per
|
||||
// conversation — index preview + hash + unread, no message-file I/O)
|
||||
// and compare it against what is already on screen. The old path
|
||||
@@ -256,7 +249,6 @@ void ConversationListScreen::refresh() {
|
||||
_message_store->get_last_message_preview(peer_hash, preview, preview_ts);
|
||||
bool need_metadata = !have_preview;
|
||||
bool queued_drops = false;
|
||||
if (need_metadata) p_fallbacks++;
|
||||
|
||||
::LXMF::MessageStore::MessageMetadata last_meta;
|
||||
last_meta.valid = false;
|
||||
@@ -391,7 +383,6 @@ void ConversationListScreen::refresh() {
|
||||
// BEFORE any later refresh takes the lock, so a refresh in that
|
||||
// window sees the data unchanged (badge stays off) and the first
|
||||
// refresh after the flush sees unread==0 and rebuilds correctly.)
|
||||
p_t_gather = millis() - p_t0;
|
||||
bool changed = (gathered.size() != _conversations.size());
|
||||
if (!changed) {
|
||||
for (size_t i = 0; i < gathered.size(); ++i) {
|
||||
@@ -407,15 +398,7 @@ void ConversationListScreen::refresh() {
|
||||
}
|
||||
}
|
||||
}
|
||||
p_t_diff = millis() - p_t0;
|
||||
if (!changed) {
|
||||
// [PERF] temporary instrumentation — removable.
|
||||
char perf_buf[128];
|
||||
snprintf(perf_buf, sizeof(perf_buf),
|
||||
"[PERF] convlist skip rows=%u fallbacks=%u gather=%ums diff=%ums total=%ums",
|
||||
(unsigned)gathered.size(), (unsigned)p_fallbacks,
|
||||
(unsigned)p_t_gather, (unsigned)p_t_diff, (unsigned)p_t_diff);
|
||||
INFO(perf_buf);
|
||||
return; // rows on screen are current
|
||||
}
|
||||
|
||||
@@ -435,7 +418,6 @@ void ConversationListScreen::refresh() {
|
||||
_conversations.push_back(item);
|
||||
create_conversation_item(item);
|
||||
}
|
||||
p_t_rebuild = millis() - p_t0;
|
||||
|
||||
// refresh() may run while Messages remains active. Newly created rows are
|
||||
// not automatically restored to the encoder group after lv_obj_clean().
|
||||
@@ -447,16 +429,6 @@ void ConversationListScreen::refresh() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// [PERF] temporary instrumentation — removable.
|
||||
{
|
||||
char perf_buf[128];
|
||||
snprintf(perf_buf, sizeof(perf_buf),
|
||||
"[PERF] convlist build rows=%u fallbacks=%u gather=%ums rebuild=%ums total=%ums",
|
||||
(unsigned)gathered.size(), (unsigned)p_fallbacks,
|
||||
(unsigned)p_t_gather, (unsigned)p_t_rebuild, (unsigned)(millis() - p_t0));
|
||||
INFO(perf_buf);
|
||||
}
|
||||
}
|
||||
|
||||
void ConversationListScreen::flush_pending_name_writes() {
|
||||
@@ -655,8 +627,6 @@ void ConversationListScreen::set_home_callback(HomeCallback callback) {
|
||||
|
||||
void ConversationListScreen::show() {
|
||||
LVGL_LOCK();
|
||||
// [PERF] temporary instrumentation — removable.
|
||||
const uint32_t p_show_start = millis();
|
||||
_visible = true;
|
||||
lv_obj_clear_flag(_screen, LV_OBJ_FLAG_HIDDEN);
|
||||
lv_obj_move_foreground(_screen); // Bring to front for touch events
|
||||
@@ -684,14 +654,6 @@ void ConversationListScreen::show() {
|
||||
lv_group_focus_obj(_btn_new);
|
||||
}
|
||||
}
|
||||
|
||||
// [PERF] temporary instrumentation — removable.
|
||||
{
|
||||
char perf_buf[64];
|
||||
snprintf(perf_buf, sizeof(perf_buf), "[PERF] convlist show=%ums",
|
||||
(unsigned)(millis() - p_show_start));
|
||||
INFO(perf_buf);
|
||||
}
|
||||
}
|
||||
|
||||
void ConversationListScreen::hide() {
|
||||
|
||||
@@ -1118,19 +1118,12 @@ void UIManager::render_route(Route route) {
|
||||
case Route::HOME:
|
||||
_home_screen->show();
|
||||
break;
|
||||
case Route::MESSAGES: {
|
||||
// [PERF] temporary instrumentation — removable.
|
||||
const uint32_t p_route_start = millis();
|
||||
case Route::MESSAGES:
|
||||
_conversation_list_screen->refresh();
|
||||
_pending_conversation_refresh = false;
|
||||
_last_conversation_refresh_ms = millis();
|
||||
_conversation_list_screen->show();
|
||||
char perf_buf[64];
|
||||
snprintf(perf_buf, sizeof(perf_buf), "[PERF] convlist route=%ums",
|
||||
(unsigned)(millis() - p_route_start));
|
||||
INFO(perf_buf);
|
||||
break;
|
||||
}
|
||||
case Route::MAP:
|
||||
_map_screen->show();
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user