mirror of
https://github.com/torlando-tech/pyxis.git
synced 2026-09-25 22:23:37 +00:00
refresh() previously opened + parsed each conversation's newest message file (load_message_metadata) on every list refresh, which dominated list-load time on SPI LittleFS. It now reads the per-conversation last-message preview + timestamp from the store's in-memory index (O(1), zero I/O) and falls back to load_message_metadata only when the index has no cached preview — the first refresh after a firmware upgrade or after a corrupt-tail drop — then writes the preview back through so the fallback happens at most once per conversation per firmware generation. The write-through is skipped when drops were queued (the drained deletes move the tail, so a preview written for the old tail would be stale for one refresh). Host benchmark (x86 + POSIX fs, 24 msgs/conv): the per-conversation store-load work drops from ~0.149ms (9 convs) / ~0.342ms (20 convs) to ~0.002ms / ~0.005ms, and the cold-boot path (store reconstructed from disk) matches the warm path because the preview now persists in the index. Bumps the microLXMF pin to c8d3156 (feat/conversation-preview-cache) in platformio.ini, the release audit, and the native reference test. Adds tests/microlxmf/bench_conversation_list_load.cpp (baseline vs index warm/cold) and the bench target in tests/microlxmf/CMakeLists.txt.