Remember each text's thread root on the device #288
Labels
No labels
area/ci
area/desktop
area/packaging
area/protocol
area/reading
area/ui
area/web
area/writing
kind/bug
kind/feature
kind/infra
kind/request
needs/user
parked
perf
security
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
littlefox/neokom#288
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Approved for 0.7 (D-063). Follows up a note on #243.
The first time a channel's newest texts are grouped into threads (#242, step 1a), each text is walked up to its thread's root. That costs one server call per text in a chain.
Kom::thread_rootremembers roots within a session, but they are lost on reload.Keep text → root on the device:
That makes the walk once per device instead of once per session.
Tests: unit tests for the store; the perf spec measures channel-list calls on a second login (a budget, #287).
Before building this I looked at what it would save now, after #284/#285, and it's less than the issue assumed. Flagging it rather than building it as written.
What a thread list costs on a second login, per card:
topic_root). This is what #288 would keep on the device. Since #285 it fetches the 64 texts before it in the channel at once, so a 3 000-long chain costs a few dozen round trips, not 3 000.thread_info: reply count, latest posts, participants, unread). Batched (16 at a time), but every text's stat, and its first line for split-offs (#284). This is the bigger part, and #288 as written doesn't touch it: the index lives for the session.So keeping roots alone would save step 1 only, which is already cheap. Measured on the seeded 3 000-long Jättetråd: the list card appears in ~8 s locally; almost all of that is step 2.
Options:
My recommendation: C now, and A if the budget says so. Labelled
needs/user; I'm going on with #287 meanwhile.Dropped by the user (D-064), 2026-10-23: "Alrigt, then drop #288". Since #285 and #305 the walk up to a thread's root fetches the texts before it at once (a few dozen round trips for a 3 000-long chain), so keeping roots on the device would save a second or two. What costs time is reading the thread down for its index, which #288 didn't cover. The perf budgets (#287) will show if a second login or the thread lists get slow; then keeping the thread index on the device is the thing to do.