wire-android_legacy icon indicating copy to clipboard operation
wire-android_legacy copied to clipboard

Large chats are really slow

Open juliss95 opened this issue 7 years ago • 14 comments

The problem

When you open a big conversation, Wire takes 2-3 seconds to load the chat. Sending a message in a big chat takes 2-5 seconds (sometimes sending the message twice or more times). And same goes for when you're going into the media overview. I have the feeling that everything is 10x as slow as in small chats. I think there's still a lot of room for optimization regarding the handling of larger chats!

Environment

  • Wire version that exhibits the issue: 3.3.374 (and all of the versions before)
  • Last Wire version that did not exhibit the issue (if applicable): -
  • Android OS version used to run Wire: 5.0.2
  • Is this a custom firmware or a stock one: MIUI 8
  • Mobile phone model/manufacturer: Xiaomi Mi2S
  • Mobile network type (EDGE/LTE/Wi-Fi/Offline): -

Details

The chat which has the loading times mentioned above has ~100.000 messages and ~2000 pictures. But generally, the larger a chat, the worse the loading times of it. Especially the times, that it needs to send messages can be a huge bummer...

juliss95 avatar Nov 25 '17 01:11 juliss95

A workaround could be to erase the chat history. This might be useful in combination with the planned "export/backup" of chat history. I know some other messengers only keep the most recent messages (like a few hundred) around in the immediate history and the rest is read on demand from an (internal) archive if someone scrolls up or uses a search function. Wire might have to do something similar but make sure encryption is ensured. Also archiving and self-destructing messages don't go well together. So whatever is archived should be older than the oldest self destructing message still hanging around. Another issue is if someone (chat partner) deletes a message which is old and has already been archived or even backed up by their peers. Obviously theres limits to the extend to which deleting of already sent message can be guaranteed (after all people could always modify their client to dump a full clear text log to disk of anything they receive - self destructing or not) But I think the solution to this problem is to write older messages into an internal archive instead of having them in memory as individual objects, and only open this archive when someone scrolls up or even presses a button ("load older messages")

CorvusCorax avatar Nov 25 '17 09:11 CorvusCorax

Yeah, those are changes that i was thinking about, cause in this state Wire is hardly usable as a primary messenger with close ones who you write a lot. Because currently Wire is so overwhelmed in my biggest chat, that it takes sometimes really long with a stupid lag until a message is sent. And during that lag, the message often sends 2-5 times or stays in the message box even after sending. Or it even doesn't show up in the chat until you restart Wire.

So maybe a solution would be, to for example just load the last 200 messages and automatically load the previous 200 messages as you are scrolling up. That would improve the UX by a lot when it wouldn't load 100.000+ messages every time i open that chat.

juliss95 avatar Nov 26 '17 08:11 juliss95

workaround: i just tested, you can erase the chat history manually by deleting a contact. the contact will then show up in the list of archived contacts, and can be restored, but the chat history is ( permanently ) gone. that might not in all cases be desired, but it probably beats running out of memory until theres a better improvement.

CorvusCorax avatar Nov 26 '17 13:11 CorvusCorax

The thing is.... I want my chat history AND a working messenger. ;-)

juliss95 avatar Nov 26 '17 16:11 juliss95

Hi, thanks for reporting. Does this issue happen in a group chat or in a 1:1? Or both?

someoneEsle avatar Nov 28 '17 08:11 someoneEsle

I don't really have large group chats, so it's hard to judge. My smaller group chats open as quickly as they should.

juliss95 avatar Nov 30 '17 12:11 juliss95

i can confirm that the slowdown happens on group chats as well

edinosma avatar Dec 06 '17 02:12 edinosma

Ok, then Wire probably has generally problems handling larger chats

juliss95 avatar Dec 07 '17 19:12 juliss95

it seems like this is still a problem in 2020. wire is just so unbelievably unusably slow it causes me great frusturation and im considering just stopping using it entirely

neonpixii avatar Mar 13 '20 22:03 neonpixii

Yo, self serving dev here, I'm quarantined, wire startup I can go with, the 2-3 sec freeze when sending a message is a total pain in the ass.

As someone said, I don't want to delete my history, any way I could be pointed to some part of the codebase to try to tinker around to fasten things up ?

Just looking through, I would say we need to benchmark this part https://github.com/wireapp/wire-android/blob/78e642aaf592584212ca47ba80aa8245aa1a5753/app/src/main/scala/com/waz/zclient/cursor/CursorController.scala#L226-L248

Not sure how to improve all of that. Classic stuff, don't do just in time work that can be done better if it's expensive. But I can't see quite what is expensive there.

edit: I'm not even sure i'm in the right place tbh.

Sinewyk avatar Mar 21 '20 23:03 Sinewyk

Hmm, actually message feedback is almost instant and fluid when sending and seeing the sent feedback, then UI freezes when updating to delivered, so it must be the delivered system that is causing the UI freeze.

Sinewyk avatar Mar 23 '20 19:03 Sinewyk

Latest release seem to have done the trick, I don't have any UI freeze anymore.

Sinewyk avatar Apr 28 '20 15:04 Sinewyk

And it's back. Exact same stuff, delivered makes the whole UI freezes up.

Regression somewhere ?

Sinewyk avatar Jun 27 '20 09:06 Sinewyk

Are there any updates to this issue?

Wire is essentially unusable on my android device because sending a message causes the entire phone to lock up for several seconds.

The wire desktop app doesn't suffer from this problem.

ns247 avatar Sep 29 '20 15:09 ns247