Every new post anywhere is downloaded in full, pictures included #240

Closed
opened 2026-10-21 19:22:21 +00:00 by littlefox · 1 comment
Owner

Found in the performance review (#230, D-058).

events.rs notify_new_text runs for every new text in every conference we are a member of. For each one it fetches:

  • the text stat;
  • the mute check;
  • a full kom.preview: the whole body, pictures included, plus a get-text-stat for every link and name lookups;
  • the stat of every parent.

The preview is fetched before checking whether any notification kind is turned on, because "Nämner dig" (#217) needs to know about mentions. So on a busy server, every post in every channel you are in is downloaded in full as it is written, whether or not you will ever read it, and whatever the notification settings.

Directions:

  • Mentions: look for <person N: or the person's name in the body only (kom.body), without building a view.
  • Pictures: for a text whose content type is a picture, don't fetch the body at all.
  • Passive memberships: skip them; they are already skipped for unread.
  • Rate: cap how many of these run at once, so a burst of posts (for example an importer) doesn't queue hundreds of fetches in front of what the user is reading.
Found in the performance review (#230, D-058). `events.rs` `notify_new_text` runs for every new text in every conference we are a member of. For each one it fetches: - the text stat; - the mute check; - a full `kom.preview`: the whole body, **pictures included**, plus a `get-text-stat` for every link and name lookups; - the stat of every parent. The preview is fetched before checking whether any notification kind is turned on, because "Nämner dig" (#217) needs to know about mentions. So on a busy server, every post in every channel you are in is downloaded in full as it is written, whether or not you will ever read it, and whatever the notification settings. Directions: - **Mentions:** look for `<person N:` or the person's name in the body only (`kom.body`), without building a view. - **Pictures:** for a text whose content type is a picture, don't fetch the body at all. - **Passive memberships:** skip them; they are already skipped for unread. - **Rate:** cap how many of these run at once, so a burst of posts (for example an importer) doesn't queue hundreds of fetches in front of what the user is reading.
Author
Owner

Merged in #260; main run #429 green. Verified: notifications, mentions, messages, side-column, presence and inbox specs on three profiles; tools/perf.sh with a burst of 20 new posts (10 pictures) from another session: server calls 97 → 19, main-thread time 0.22 → 0.05 s.

Merged in #260; main run #429 green. Verified: notifications, mentions, messages, side-column, presence and inbox specs on three profiles; `tools/perf.sh` with a burst of 20 new posts (10 pictures) from another session: server calls 97 → 19, main-thread time 0.22 → 0.05 s.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
littlefox/neokom#240
No description provided.