[GH-ISSUE #8051] Game Mode: skipping, revealing and settings toggles reprocess the whole loaded history #7538

Closed
opened 2026-10-24 04:04:00 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @kolacheee on GitHub (Oct 22, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8051

Originally assigned to: @kolacheee on GitHub.

Follow-up to #8030. In a long game, skipping, revealing, sending, jumping from the Session Log or toggling a chat setting lags, and the lag grows with the number of loaded messages. Display regex scripts make it much worse.

On staging, each of those actions redoes work across every loaded message, even with the Session Log closed:

  • The Session Log entries are rebuilt on every step. Every message is parsed again and every line goes back through macros and the display regex scripts.
  • Each regex script's pattern is checked for safety and compiled again for every line it touches.
  • Any chat metadata write replaces the segment edit and delete overlays with new objects, even when nothing in them changed. That rebuilds the log entries, the review list and the translation sources for every message.
  • The game's character list is also rebuilt as a new array on every metadata write.

Measured on a production build: a 250-message game with 3 characters with sprites, 30 display regex scripts and Messages per page at 0, on a Pixel 7 viewport at 4x CPU throttle. Next takes 424 ms and a log jump takes 504 ms.

Originally created by @kolacheee on GitHub (Oct 22, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8051 Originally assigned to: @kolacheee on GitHub. Follow-up to #8030. In a long game, skipping, revealing, sending, jumping from the Session Log or toggling a chat setting lags, and the lag grows with the number of loaded messages. Display regex scripts make it much worse. On staging, each of those actions redoes work across every loaded message, even with the Session Log closed: - The Session Log entries are rebuilt on every step. Every message is parsed again and every line goes back through macros and the display regex scripts. - Each regex script's pattern is checked for safety and compiled again for every line it touches. - Any chat metadata write replaces the segment edit and delete overlays with new objects, even when nothing in them changed. That rebuilds the log entries, the review list and the translation sources for every message. - The game's character list is also rebuilt as a new array on every metadata write. Measured on a production build: a 250-message game with 3 characters with sprites, 30 display regex scripts and Messages per page at 0, on a Pixel 7 viewport at 4x CPU throttle. Next takes 424 ms and a log jump takes 504 ms.
bsakaguchi 2026-10-24 04:04:00 +07:00
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
Pasta-Devs/Marinara-Engine#7538
No description provided.