summaryrefslogtreecommitdiff
path: root/platform-paper/src/test
diff options
context:
space:
mode:
authorSho Sakuma <me@m1sk9.dev>2026-08-03 00:45:44 +0900
committerSho Sakuma <me@m1sk9.dev>2026-08-05 00:42:23 +0900
commit790dcf942a3acab1268d46e3fc22be25a4ee02d5 (patch)
tree386234a8c0fbbc37a4d606f8b6db165ab95f0444 /platform-paper/src/test
parent1ee7a7fb0b24a99daace60016468774a5bd6fbf4 (diff)
downloadLunaticChat-790dcf942a3acab1268d46e3fc22be25a4ee02d5.tar.gz
LunaticChat-790dcf942a3acab1268d46e3fc22be25a4ee02d5.tar.bz2
LunaticChat-790dcf942a3acab1268d46e3fc22be25a4ee02d5.zip
perf: only do spy and cache work when it will be used
Spy notification ran per recipient what it could run once: both handlers looked up general.spyMessage and rebuilt the hover component inside the forEach, and the direct message path also allocated a Set inside the filter predicate, once per spy per message. It formatted the spy copy of the message before discovering there were no spies to send it to - and spies are rare, so that was the normal case. SpyPermissionManager.notifySpies now owns the whole shape. It takes the body as a lambda so nothing is built for an empty audience, attaches the hover once, and reads the roster directly rather than through getDirectMessageSpyPlayers()'s defensive copy. It also puts "who must not see this" in one place; the two handlers had drifted to expressing it by name in one and by UUID in the other. ConversionCache tracked no dirtiness, so the periodic task re-serialized and rewrote the entire cache file on its fixed interval whether or not anyone had chatted, while every single put scheduled another full rewrite five seconds out. It now records that it changed and the periodic task is the only writer, returning immediately when there is nothing to write. A failed write marks the cache dirty again so the next tick retries. Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat (limited to 'platform-paper/src/test')
0 files changed, 0 insertions, 0 deletions