signalapp / Signal-Desktop

A private messenger for Windows, macOS, and Linux.
https://signal.org/download
GNU Affero General Public License v3.0
14.61k stars 2.66k forks source link

App extremely slow to "Load messages" on macOS desktop #1990

Closed arikroc closed 5 years ago

arikroc commented 6 years ago

v1.1.0

macOS 10.13.2

Loading messages ... took >30 seconds, for about 600 messages

Yes I've searched. This is very similar https://github.com/WhisperSystems/Signal-Desktop/issues/1842 though mine is on mac not linux and mine is 1.1.0

Steps to repro

Get a few hundred messages

then launch signal latest on mac

actual result: it's very slow to start

expected it would launch instantly

unfortunately i'm not comfortable including anything from the logs. sorry i realize this is overly paranoid.

Mushoz commented 5 years ago

@Sethur the chrome app would always run in the background whenever you have Chrome open. So even if you only use signal once every 3 days, as long as you used Chrome in between it would have time to keep up to date, hence the better user experience when finally opening the app. The standalone Electron app doesn't have this advantage.

However, even though the difference in experience is easily explained, I do have to agree that the current synchronization speed is still unacceptable if we ever want the masses to start using Signal. What is the current bottleneck anyway? Even on my 500/500 Mbit connection, 8 core/16 thread Ryzen processor, 16GB RAM and NVME SSD, I am only syncing around 10-20 messages a second. That's insanely slow for how small these messages are. Shouldn't we easily be seeing thousands of messages per second with current technology?

scottnonnenberg-signal commented 5 years ago

@Mushoz if you're really interested in the performance, I encourage you to watch the log (using the dev tools) during a big download some time. Most of the biggest delays are attachment downloads. At some point Desktop will download attachments out-of-band, which will help. But contact/group syncs will always need to be downloaded while processing the message.

joaobarcia commented 5 years ago

Is there any reason why all attachments must be downloaded on app launch? Sounds terribly inefficient. What if one day you transferred a zip with 500mbs of photos to a friend over signal? Every time in the future you want to send a two word message to any of your contacts you have to download 500mbs?

Why not download upon request?

Sethur commented 5 years ago

@Mushoz : You are, of course, right regarding the Chrome app running in the background all the time and thus circumventing the synchronization issues, I wasn't thinking about that.

@joaobarcia @scottnonnenberg : I just started Signal Desktop again after only one day of inactivity. None of my groups posted any images, besides standard emojis (not sure if they are send as unicode or images). There were altogether maybe 15 messages that needed synchronizing. Startup nevertheless took 18.3 seconds on a dual Xeon board with 32 GB and 20 cores (40 with hyperthreading) with a 1 Gbit/s (100 MB/s) internet connection. So I'd wager to say that attachment downloads are not the only problem with the current implementation.

Is it generally necessary to fully download attachments in order to decrypt the following group/contact messages? If this is not the case, I would suggest prioritizing the implementation of out-of-band attachment downloads (preferably even on-demand if the user choses so) right away. Many users will not tolerate Blender-like startup times for a messenger app, end-to-end encrypted or not. This is especially true for people that were using something like XMPP before. It just feels like a big step backwards.

leonardehrenfried commented 5 years ago

@Sethur: I totally agree with your point.

Can you post your debug log?

(I'm not a Signal developer but @scottnonnenberg is probably tired of asking the same thing over and over.)

mulder999 commented 5 years ago

It was slow loading with 20 messages, now with some hundreds it is a nightmare. It seems there are many unitary requests each being around or over 100ms. Running on Fiber in Europe, my ping to 1.0.0.1 and 8.8.8.8 is 5ms. Using https://www.cloudping.info/ I see values between 26 and 346ms. Might eventually dig into code while waiting for data loading...

Extract of the logs

INFO  2018-12-09T16:42:54.535Z draw attention
INFO  2018-12-09T16:42:54.623Z Approving request for permission 'notifications'
INFO  2018-12-09T16:42:54.718Z SQL channel job 4678 (removeUnprocessed) succeeded in 140ms
INFO  2018-12-09T16:42:55.367Z SQL channel job 4680 (createOrUpdateItem) succeeded in 118ms
INFO  2018-12-09T16:42:55.604Z SQL channel job 4683 (updateConversation) succeeded in 80ms
INFO  2018-12-09T16:43:48.559Z Sending a keepalive message
INFO  2018-12-09T16:44:43.662Z Sending a keepalive message
INFO  2018-12-09T16:44:57.876Z Remove all notifications
INFO  2018-12-09T16:44:57.978Z SQL channel job 4685 (saveMessage) succeeded in 98ms
INFO  2018-12-09T16:44:58.135Z SQL channel job 4688 (updateConversation) succeeded in 149ms
INFO  2018-12-09T16:44:58.135Z Sending 1 read receipts
INFO  2018-12-09T16:44:58.235Z SQL channel job 4697 (createOrUpdateSession) succeeded in 93ms
INFO  2018-12-09T16:44:58.235Z PUT https://textsecure-service.whispersystems.org/v1/messages/+[REDACTED]699
INFO  2018-12-09T16:44:58.545Z PUT https://textsecure-service.whispersystems.org/v1/messages/+[REDACTED]699 200 Success
INFO  2018-12-09T16:44:58.654Z SQL channel job 4707 (createOrUpdateSession) succeeded in 104ms
INFO  2018-12-09T16:44:58.712Z PUT https://textsecure-service.whispersystems.org/v1/messages/+[REDACTED]728 (unauth)
INFO  2018-12-09T16:44:58.875Z Update notifications:
Sethur commented 5 years ago

I have just had another case of just one day of inactivity. When I came back, over 400 messages where sychronized. I do not seem to understand what constitutes a single "message" in signal, since there were definitely no 400 messages in all my contacts during that time. I would estimate the actual number to be lower than 30. Startup was again frustratingly slow and took nearly 80s when you include the time electron itself needs for launch. If I remember correctly, there have not been any images or documents that have been send while I last used the app, so this all came from text messages.

I can only continue to emphasize the importance of fixing this. Wide-spread user adoption will not happen with this kind of performance.

Corresponding debug log is in the attachments.

debug.log

Mushoz commented 5 years ago

@Sethur as far as I understand it, the concept of a message is an abstract thing. It can mean an actual text message, but it can also mean stuff like sending/receiving the time a message was sent, the time a message was received on the other end, and finally the time at which a message was read.

Basically anything that requires communication with the signal servers will constitute a message, not just the actual text messages. So the much higher message count when syncing than actual number of text messages is completely normal and unavoidable (just a confusing way of naming it to be fair).

The slow speed at which there messages are processed though, is really not acceptable for widespread adoption. I use my laptop during the week for work, but rarely use it during the weekend. The first launch of Signal on Monday usually takes minutes.

praetp commented 5 years ago

Still very slow in v1.19.0 on Linux. Already waiting for 10 minutes..

scottnonnenberg-signal commented 5 years ago

This is our central place for tracking load-time performance: https://github.com/signalapp/Signal-Desktop/issues/3010

4mig4 commented 5 years ago

I have also the same problems using 1.19.0 on Linux

d-3-n commented 5 years ago

This is still an issue, or became issue again after some time, since people reported it as solved. Windows 10 64 bit. It is as if everything has been done in one single thread, GUI and message loading, GUI won't become functional before all messages are processed. Anyhow, having to wait 700 messages to load before being able to use Signal is PITA. Can you put this in background, and enable sending/receiving of messages plus access to contact list while old messages ones are being loaded?

phs92 commented 5 years ago

Same Problem here, very annoying, thought Signal was a very good alternative to Whatsapp. Win 10 Pro 1809, i7 8550u, 512gb SSD, 16GB ram

Mushoz commented 5 years ago

@scottnonnenberg @scottnonnenberg-signal I am unable to post in issue #3010

Could you please reopen said issue so I can add some additional information?

scottnonnenberg-signal commented 5 years ago

No. Create a new issue, and follow the template.