-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Message window with many messages slows down game massively #5898
Comments
I rarely delete messages and my message box is always full of messages, i never noticed a slow down of the game when opening the message box. Opening the minimap slows down the game for me, but i think this might be because i use always a debug build. |
it does I normally use release builds to test things as they compile (or more precise link) much quicker and I only use debug if necessary. |
@frankystone do you have the message box open all the time? or do you open and close it frequently. |
I open it very rarely. Mostly to lookup for geologist messages. Here is a savegame with 140 messages in the inbox. I notice no slow down with this amount of messages. |
ok here is a savegame which literally stops the game while being open. (more then 1000 messages maybe I remembered the amount wrong in the first post.) |
this has nearly the same effect on my windows machine game slows down immediately only if i filter to a reasonable amput the game is running normally |
I can confirm that a message window like that causes the stuttering. The problem is probably that we create an Objects mutex while the UI is self-updating: widelands/src/ui_basic/panel.cc Lines 393 to 396 in 7147e59
The message window on every UI cycle iterates over all currently shown messages to see whether they're still valid, and then over the player's entire inbox to check for each visible message whether it's in the list. I don't immediately see an easy way to mitigate this for such a large inbox though. |
Over 1 thousand messages :-D Maybe there can be an auto archive function? Say e.g. max 500 recent messages and if there are more they get archived, or time based, depending on the time autosaves will be created: If autosave time is 10 Minutes all messages older than 10 Minutes get archived (this is probably too fast, so autosave time * 2 would maybe fit better). |
As said above I have nerly the same effect with the savegame provided by @frankystone |
My first thought without knowing the exact cause was to eventually maintain the list outside of the window, to better distribute computing time. But I don't know whether this would be doable |
I wouldn't like messages being archived automatically, but we could show only the first 20 or so messages with a "show more (+980)" button that loads the next batch of 20 messages (like in long GitHub conversation threads). Or pagination with only 10 messages per page. What do you think?
How do you mean? The actual message queue is a property of the game logic, complete with PlayerCommands to set the read/archived state of messages; and the messages window provides a representation of that queue (which requires constant cross-updating, as the queue contents change frequently, e.g. when a map object is deleted its associated messages disappear). |
pagination is a very good idea. +1
Ok forget it thanks for the explanation |
Describe the bug
If your message window accumulated a lot of messages (approx more then 50 and up - easy to achieve in a long game) the game gets slowed down very much. even selection of messages or single deletions are delayed. only CTRL-A ->del might help although taking seconds
To reproduce
Expected behavior
Keep the performance when viewing messages
The text was updated successfully, but these errors were encountered: