UnigramDev / Unigram

Telegram for Windows
https://www.microsoft.com/store/apps/9n97zckpd60q
GNU General Public License v3.0
3.9k stars 452 forks source link

There is a lot of UI lag and dropped UI interactions #1272

Open foxmajik opened 4 years ago

foxmajik commented 4 years ago

The UI has frequent jank and lag. It seems like you are giving priority to backend data handling and ignoring the importance of responsive UI.

Sometimes UI elements have to be clicked 2-3 times before they respond (ie, clicking to switch to a different chat often doesn't get a UI response) so it seems that you are dropping user inputs when the app is busy rather than buffering them.

UI responsiveness should take priority over data processing handling.

Unprocessed data should go into a buffer while you handle UI events, then after you handle the UI you should process the buffered data. Same for UI. Don't just ignore a user input when you're busy, put the input into a data buffer then handle it when you have resources.

User doesn't care if it takes longer for a message to appear but if you don't respond to their input or display stuff they are typing they want to stop using your app.

MarcAnt01 commented 4 years ago

Unigram is fast and responsive here, what is your device hardware?

FrayxRulez commented 4 years ago

Any kind of input is handled by UWP (and then by Windows/Microsoft) and not by the app, that just consumes data provided by the system.

Your UX doesn't sound any normal tho, never experienced anything like this in 3 years developing and using this app (Even now that I'm forced to use it in a VM)

AnggaSP commented 4 years ago

Can confirm that UI has a lot of janks, especially with multiple account (I have 2 accounts, all have multiple groups and channels which usually have 1000+ chats in every group every day)

I can help profile it if you need the data.

xperiandri commented 4 years ago

For example, when you activate the search bar, then click on a quick suggestion. Then you have to wait around 2 seconds for a chat to appear.

MarcAnt01 commented 4 years ago

For example, when you activate the search bar, then click on a quick suggestion. Then you have to wait around 2 seconds for a chat to appear.

That sounds more pointless that the issue itself, since it depends on Telegram servers and using every client the delay is the same

xperiandri commented 4 years ago

That delay does not matter. UI must appear first instantly (maybe with dummy placeholders until the server responds). But otherwise, you just don't understand what is going on

FrayxRulez commented 4 years ago

I think it's not a news that UWP lags like hell?

MarcAnt01 commented 4 years ago

Well, I think that's a small detail that just 0,1% of users would notice, or at least looks in this way with my laptop (maybe in PCs with worse hw it'll be a lot worse)

FrayxRulez commented 4 years ago

If you click on a message sent by you in search results the app is going to lag due a bug in the Windows platform that Microsoft never fixed: https://github.com/microsoft/WindowsCompositionSamples/issues/329

AnggaSP commented 4 years ago

What about intermittent freeze when typing, navigating, or general use of the apps? I sometimes encounter freeze for up to 2secs, UI is totally unresponsive, clicking anything won't do anything. I can still type tho (with it freeze but the text will eventually registered after it unfreezed)

Sometimes, text is doubled too, for example i type this and it also typed "nd it also typed" a chunk of it from micro freezes.

xperiandri commented 4 years ago

(maybe in PCs with worse hw it'll be a lot worse)

Core i7 8650U, 16GB RAM, SSD NVMe

MarcAnt01 commented 4 years ago

(maybe in PCs with worse hw it'll be a lot worse)

Core i7 8650U, 16GB RAM, SSD NVMe

Same hardware here, apart from the Ram

xperiandri commented 4 years ago

I think it's not a news that UWP lags like hell?

I agree in general but not in my case. This case is a matter of algorithm and UX design

FrayxRulez commented 4 years ago

I think there’s a lot of confusion going on here as any action that require some loading always update the UI first and then loads the data.

AnggaSP commented 4 years ago

Can we go back to the original issue at hand?

xperiandri commented 4 years ago

I think there’s a lot of confusion going on here as any action that require some loading always update the UI first and then loads the data.

But why then chat section of a window does not appear instantly when I click on a quick contact suggestion?

FrayxRulez commented 4 years ago

But why then chat section of a window does not appear instantly when I click on a quick contact suggestion?

What is this?

xperiandri commented 4 years ago

image

FrayxRulez commented 4 years ago

Because UWP is really slow to initialize and load the UI

xperiandri commented 4 years ago

But lag only happens for quick contact suggestions. It does not happen for conversation opened from conversation list.

FrayxRulez commented 4 years ago

It doesn't happen for quick contact suggestions here

MarcAnt01 commented 4 years ago

It doesn't happen for quick contact suggestions here

I have understood that to reproduce you have to close the app and open it again, it seems to happen just the first time, once loaded the next times it won't happen

FrayxRulez commented 4 years ago

Then as I said it happens for the first chat you open, doesn't depend on the interaction source

xperiandri commented 4 years ago

No, it happens always. 1-2 seconds lag is rare while some comparably noticeable delay happens always

hatzkel commented 4 years ago

Here this just started happening recently as well for me. Here is an example: image

MarcAnt01 commented 4 years ago

@hatzkel you are writing in the wrong ticket

xperiandri commented 4 years ago

@hatzkel, I had the same issue until I updated to 3.13.2647

hatzkel commented 4 years ago

I just updated and it started happening. :O I figured this was the right ticket since I was considering it "dropped UI interactions and or ui interaction lag" 🤷‍♀️

MarcAnt01 commented 4 years ago

I just updated and it started happening. :O I figured this was the right ticket since I was considering it "dropped UI interactions and or ui interaction lag" 🤷‍♀️

You have just posted it in the wrong ticket, creating confusion. Next time, kindly check the ticket description, from which you'll understand what it is about

hatzkel commented 4 years ago

Wow your English is so horrible that I don't even think you understand what I said. You don't see me trying to be smart in Italian maybe you should stick to coding and speaking Italian rather than handle support tickets written in English.

FrayxRulez commented 4 years ago

image

AnggaSP commented 4 years ago

https://streamable.com/0egbg

Hopefully this would illustrate the issue better

For context, my machine: i3-4150 8GB DDR3-1600 256GB SATA SSD

FrayxRulez commented 4 years ago

You can try to disable visual effects from System settings.

foxmajik commented 4 years ago

I switched to Telegreat because it supports blocking users in group chats. ¯_(ツ)_/¯

AnggaSP commented 4 years ago

Same here, end up resorting to many instance telegram client and it's never been this fast Sorry for OOT but I don't think anybody is looking at this issue.

MarcAnt01 commented 4 years ago

I switched to Telegreat because it supports blocking users in group chats. ¯(ツ)

This is completely off topic and isn’t going to help at all here

foxmajik commented 4 years ago

I switched to Telegreat because it supports blocking users in group chats. ¯(ツ)

This is completely off topic and isn’t going to help at all here

Pretty sure your comment isn't helpful either, and yet there it is.

Perhaps you should focus less on attacking users and more on fixing bugs?

MarcAnt01 commented 4 years ago
  1. I am not a developer
  2. You can't tell me what to do and I don’t owe you anything
  3. How do you think that telling us you switched to another client is going to help somehow?
foxmajik commented 4 years ago

I switched to a different fork, so I'm done here.

FrayxRulez commented 4 years ago

I switched to a different fork, so I'm done here.

Unigram isn’t a fork. And the fact that you moved to something else doesn’t mean that the problem is solved.

Kenya-West commented 4 years ago

Can confirm, Unigram doesn't respond fast after sleep mode. After computer wakes up, Unigram can lag about 2-3 sec. and only then responds. I have close the app and then reopen it. Same behaviour on i7-6700K, 48GB, 2TB SSD, GTX 710.

notthebee commented 4 years ago

Same here. Unigram will become slow and laggy after some time. Text would take 5 seconds to actually appear after typing sometimes, mouse clicks won't register, etc.

FrayxRulez commented 4 years ago

IMHO most of this problems highly depend on UWP rather than on the app itself, I don't think that this framework was ever optimized for this kind of "real world scenario". @notthebee do you frequently switch between multiple accounts?

Lovemetal commented 4 years ago

Same, it only happens when I switch between accounts (I have 3). Unigram will become laggy and unresponsive, I'll have to click UI elements multiple times before they respond. Also there will be double notification sound.

FrayxRulez commented 4 years ago

Same, it only happens when I switch between accounts (I have 3). Unigram will become laggy and unresponsive, I'll have to click UI elements multiple times before they respond. Also there will be double notification sound.

Yes, this is understandable. When you switch between accounts a new view is created but due to a bug previous ones aren't ever garbage collected. This means that they will keep accumulating into app memory making it slower. Honestly fixing this is absolutely non-trivial and I never managed to.

Kenya-West commented 4 years ago

@FrayxRulez thanks for explanation how it works! For me since 4.0 release there are no notable lags except only one: when I search for my own old (1+ year) message and click on it, Unigram and entire Windows 10 kinda freezes up for ~40 seconds - I can't click anything on any window, but music plays on, I can drag cursor anywhere. You can see this lag on a video in OneDrive between 0:12 and through the end.

FrayxRulez commented 4 years ago

@Kenya-West this is a UWP bug that I reported so long ago that I can’t even remember where to find the ticket. It is caused by the list element tilt effect (the thing that makes element move in the “3D space” when you click on them) + the sent/read check mark, because of a internal UWP bug. Tilt effect for some reason can’t be disabled (chat list doesn’t have it because I spent really a lot of time writing a list component myself for this scope) and I guess that the only sane solution would be to remove the read/sent ticks from messages results list.

Kenya-West commented 4 years ago

this is a UWP bug that I reported so long ago that I can’t even remember where to find the ticket

@FrayxRulez I found a new official Microsoft repo where you can possibly report the bug again. I guess this is a right channel

lzlrd commented 3 years ago

I'm not sure if this helps, but when transitioning from an administrator to standard account I started experiencing lags.

lzlrd commented 3 years ago

I'm not sure if this helps, but when transitioning from an administrator to standard account I started experiencing lags.

UPDATE: It seems re-installing the application solves this issue but I'm able to reproduce it with another account. Does Unigram use administrator privileges for a certain file that it polls, maybe?