Files
Classic298 a9adb2b78e perf: posting in a channel takes seconds when many members are online (#32889)
Every message posted in a channel waited until the server had re-checked the login of every online member of that channel, one connected session at a time with a few database lookups each, before the post went through. In a large channel that added seconds to every single message. The result only decides who gets a notification, and the message is already delivered to everyone before this step, so the check now runs right after the post returns, as the first step of the work that sends notifications and bot replies. Members are re-checked exactly as before, including disconnecting any session whose login is no longer valid.

Postgres 16, standard channel, median time for a post to return:

| Online members | Before | After |
| --- | --- | --- |
| 100 | 0.37 s | 0.03 s |
| 300 | 1.6 s | 0.05 s |
| 1,000 | 3.4 s | 0.10 s |
2026-10-22 07:48:19 +09:00
..
2026-10-21 16:35:31 +09:00
2026-10-13 01:55:12 +04:00
2026-10-16 18:58:58 +04:00
2026-10-05 14:01:02 +04:00
2026-10-21 09:15:15 +09:00
2026-10-05 12:17:25 +04:00
2026-10-21 12:58:04 +09:00
2026-10-16 01:25:30 +04:00
2026-10-09 18:37:55 +04:00
2026-10-15 17:56:56 +04:00
2026-10-08 22:05:36 +04:00
2026-07-27 19:39:36 -04:00
2026-10-21 15:04:00 +09:00
2026-10-16 02:53:00 +04:00
2026-10-14 16:57:58 +04:00
2026-10-13 00:42:34 +04:00
2026-10-10 22:19:50 +04:00
2026-09-06 17:27:30 -04:00