Skip to content
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

UI locks while fetching data from server #218

Open
fsateler opened this issue Mar 16, 2015 · 1 comment
Open

UI locks while fetching data from server #218

fsateler opened this issue Mar 16, 2015 · 1 comment

Comments

@fsateler
Copy link

fsateler commented Mar 16, 2015

I recently expanded the amount of buffer lines to keep on the server, and noticed that now the extra data to fetch results in the UI becoming unresponsive while the data is being loaded.

I am not sure if the problem is lock while fetching data or while building the UI. May be the latter since CPU usage tends to spike after a successful connection to the server.

Smuxi version 0.11 on both windows and linux exhibit this behavior. The server I'm using is version 0.8.10 on debian wheezy.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@meebey
Copy link
Owner

meebey commented Mar 16, 2015

Here is some context of this issue:

17:14:24  fsateler: the issue is Smuxi does fetches the backlog in a background thread
17:14:36  fsateler: but pushes ALL messages in a single loop into the UI
17:14:40  fsateler: and that is the UI hang you see
17:14:51  and yes GTK is that slow ;)
17:15:41  so the symptom is like "hey Smuxi hangs, but this is easy to fix!" not quite
17:19:17  meebey: OK I see
17:19:28  fsateler: but it is an issue that should be fixed, no doubt
17:19:38  fsateler: it is just that it depends on user behavior/settings
17:19:45  fsateler: regular values do not cause harm :)
17:19:49  meebey: can you hint me where should I be looking (source) to find that loop?
17:19:57  sure, hold on
17:21:09  fsateler: https://github.com/meebey/smuxi/blob/master/src/Frontend-GNOME/Views/Chats/ChatView.cs#L563
17:21:34  that loop needs to process the list in chunks
17:21:40  like 100 messages per iteration
17:21:55  it can use an anonymous method/lambda expression
17:22:04  GTK has an idle loop for this
17:22:18  so it would call it when GTK has time
17:22:23  as in no UI hang
17:22:37  example https://github.com/meebey/smuxi/blob/master/src/Frontend-GNOME/Views/Chats/ChatView.cs#L462
17:23:01  the return false means it does not want to be called again
17:23:14  if you return true, it will call the callback again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants