signalapp / Signal-Desktop

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

Big/old conversation takes several minutes to load #757

Closed Dyras closed 4 years ago

Dyras commented 8 years ago

Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.110 Safari/537.36 Signal-Desktop/0.6.0

Hi. Something that has bothered me for a long time on two different computers is that whenever I open Signal for the first time, or try to scroll up in a conversation, Signal somehow slows down my entire computer by using about half of my HDD's read speed.

For me reproducing this is really simple. I just start my computer, wait a minute or two, start Chrome and then this happens.

Debug lawgs: https://gist.github.com/anonymous/e89dd4a79626031f2b0f2b14aef4ac2c https://gist.github.com/a663ab7dc742a0679489181e21d98e21 chrome data

vphantom commented 8 years ago

I'm not a dev here, but FYI if your screenshot was of Chrome's built-in Task Manager you might get more details about the offending process.

Dyras commented 8 years ago

I tried checking Chrome's task manager, but it doesn't say much at all. I'm starting to think this has to do with the fact that my conversation is huge.

Dyras commented 8 years ago

I think I've found the culprit... image Signal's leveldb folder is over 10 gig!

Folder can be found here: C:\Users\user\AppData\Local\Google\Chrome\User Data\Default\Storage\ext\bikioccmkafdpakkkcpdbppfkghcmihk\def\IndexedDB\chrome-extension_bikioccmkafdpakkkcpdbppfkghcmihk_0.indexeddb.leveldb Some kind of trimming PLEASE?

vphantom commented 8 years ago

@Dyras Wow! And that's after years of use with lots of shared media I assume? (Images, etc.) It'll be interesting to see how that can be cleaned up.

Dyras commented 8 years ago

I'd say I managed to reach 10 gigs in about 7 months. From what I could tell at first glance, every message I send increases the size of the database with at least 5 kilobytes. That's about 5 megabytes per 1000 messages, or 10k messages per maximum sized video. I refuse to believe that I've sent over 10 gigabytes of videos over the past 7 months, 2 gigabytes tops would be my estimate due to the fact that I send videos so rarely.

Now to some testing Sending the word "Test" increases the file size of 000048.log from 2868 kB to 2932. Sending a crappy picture of my Toon Link plush increased the file size -||- from 2932 kB to 3019 kB It would also seem that every picture I send creates a new file in C:\Users\user\AppData\Local\Google\Chrome\User Data\Default\Storage\ext\bikioccmkafdpakkkcpdbppfkghcmihk\def\Cache The name "cache" implies it's temporary, however it doesn't seem to be. I once tried to delete some of the cache, since it was approaching "Holy crap" size, and after restarting Signal I had to login again as if I had never used Signal. Weee!

Tomorrow I'll send a video, note with file it is in the folder and then we'll see if it ever gets deleted from the cache. Good night!

awnumar commented 8 years ago

Signal desktop is really badly designed. The mild convenience of a desktop application only slightly makes up for the horrendous decisions that were made in development.

vphantom commented 8 years ago

@libeclipse could you be specific? Given this issue's topic I assume you're referring to the data retention policy in the desktop's database? I notice that Signal for Android has a "maximum messages per conversation" setting, perhaps Desktop will soon have an equivalent. (I'd rather skip old media but retain 100% of message history, though.)

@Dyras Your database increased 64 kilobytes for sending the word "test" in a conversation? Does it by any chance then stay the same size in the following few messages? It could be a pre-allocation of sorts

Dyras commented 8 years ago

@vphantom It increases 64 or so kilobytes every message, so no pre-allocation. Unless I'm doing something wrong, which honestly wouldn't surprise me at all, I have to agree with @libeclipse that this is poorly designed. I fling pictures back and forth all day with my mom, and I chat all day with a girl. If every message/picture counts forever without ever going away, then this bug will obviously happen to everyone eventually.

EvanHahn-Signal commented 4 years ago

There hasn't been any action on this issue in over 4 years and I believe we've made some performance gains here, so I'm going to close. Let me know if that's wrong and I'll reopen!