threema-ch / threema-web

The Threema Web application.
GNU Affero General Public License v3.0
992 stars 106 forks source link

Replace ng-repeat in conversation with custom directive #40

Open dbrgn opened 7 years ago

dbrgn commented 7 years ago

The ng-repeat directive might be the source of a lot of performance problems.

Replacing it with a custom directive would probably improve a lot.

The directive would then have methods to update the status of existing messages via message id.

Refs #20 and #39.

ovalseven8 commented 6 years ago

Will this also speed up loading of conversations? If not, we should probably create a new issue. :)

Elsensee commented 5 years ago

Even though the performance has increased by a lot since the first versions of threema web I still experience a very notable lag when switching conversations - even on very fast computers. (Today I used Threema Web on the computers of my university, which gave this a completely different experience) On my own notebook (which is not as powerful) opening the emoji-picker also gives a notable delay.

I recorded the conversation changing on my notebook just now and it took 3.9s. Very much time is spent in angular's $digest-functions and from my own experiences with ng-repeat I'm remembering that it kinda does this a lot? (Not sure, though) threema-web-changing-conversation (Profiled with Chrome 71 on Windows 10)

I'd really love to see some further improvements in this area.

IndianaDschones commented 4 years ago

Using track by message.id may also help, see https://docs.angularjs.org/api/ng/directive/ngRepeat#tracking-and-duplicates But this should be testet as a negative sideeffect may (?) be, that the status cannot be updated.