Bug 465715 - ea76edce74820ae084fb29303bdeb4da8e913157 increases CPU usage and makes the app lag
Summary: ea76edce74820ae084fb29303bdeb4da8e913157 increases CPU usage and makes the ap...
Status: RESOLVED FIXED
Alias: None
Product: NeoChat
Classification: Applications
Component: General (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR major
Target Milestone: ---
Assignee: Tobias Fella
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2023-02-14 15:12 UTC by Nate Graham
Modified: 2023-08-05 14:32 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nate Graham 2023-02-14 15:12:41 UTC
ea76edce74820ae084fb29303bdeb4da8e913157 adds a BusyIndicator for URL preview loading. In chats with a lot of links, many BusyIndicator instances will be active at once. Each one consumes CPU time due to its always-playing animation. It also does not appear that the loader that loads it unloads it or stops playing the animation for BusyIndicator instances that are not currently visible.

The combination of these factors hugely increases NeoChat's CPU usage and has unfortunately made the app nearly unusable for me, as I'm in a large number of chats where people send each other links. I'm currently running the app with that commit reverted.
Comment 1 James Graham 2023-02-14 18:11:40 UTC
Hey can you give this a go https://invent.kde.org/network/neochat/-/commit/2cda1b5fa6aa276622b87c07cf68d8633f94f9d3.

It should stop the loading indicator running when the delegate isn't visible, hopefully that should reduce the load.
Comment 2 Nate Graham 2023-02-14 19:03:36 UTC
Indeed it helps a lot!
Comment 3 Bug Janitor Service 2023-02-14 19:14:20 UTC
A possibly relevant merge request was started @ https://invent.kde.org/network/neochat/-/merge_requests/797
Comment 4 James Graham 2023-02-27 08:01:08 UTC
Git commit f186be73143e0f360c27f8e4462f49c435e5c2a4 by James Graham.
Committed on 15/02/2023 at 18:22.
Pushed by nvrwhere into branch 'master'.

Disable link loading animation when offscreen

Stop the link preview loading indicator animation running when the delegate isn't visible.

M  +9    -2    src/qml/Component/Timeline/LinkPreviewDelegate.qml
M  +1    -0    src/qml/Component/Timeline/MessageDelegate.qml
M  +5    -0    src/qml/Component/Timeline/TimelineContainer.qml

https://invent.kde.org/network/neochat/commit/f186be73143e0f360c27f8e4462f49c435e5c2a4
Comment 5 James Graham 2023-02-27 08:01:26 UTC
Git commit f785e4d5b0e77f3e28fdfc5891bb6f9b0e562649 by James Graham.
Committed on 15/02/2023 at 19:30.
Pushed by nvrwhere into branch 'master'.

Inline Edit Loader

Put the edit component in a loader to that it doesn't use resources when not in use.

M  +5    -2    src/qml/Component/Timeline/MessageDelegate.qml

https://invent.kde.org/network/neochat/commit/f785e4d5b0e77f3e28fdfc5891bb6f9b0e562649
Comment 6 Nate Graham 2023-08-05 14:32:17 UTC
This appears to be effectively fix now,