Bug 431364 - Lots of Rating objects are created
Summary: Lots of Rating objects are created
Status: RESOLVED FIXED
Alias: None
Product: Discover
Classification: Applications
Component: discover (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Dan Leinir Turthra Jensen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-09 18:57 UTC by David Edmundson
Modified: 2021-01-19 15:28 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.21


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Edmundson 2021-01-09 18:57:52 UTC
Happened to have discover open in gammaray. 

I have >12000 Rating objects. (For 2000 AbstractResources).

This is over 35% of all the QObjects in the app which is a sign that's something is wrong. 
Given the properties are static, this could be a Q_GADGET rather than a property with minimal changes at a QtQuick level.
Comment 1 Nate Graham 2021-01-12 00:02:51 UTC
yikes
Comment 2 Bug Janitor Service 2021-01-14 17:24:05 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/discover/-/merge_requests/62
Comment 3 Aleix Pol 2021-01-18 16:53:42 UTC
Git commit e5e8ac5f7726a02c44c423fa5828b39e4da75d5e by Aleix Pol Gonzalez, on behalf of Aleix Pol.
Committed on 18/01/2021 at 16:52.
Pushed by apol into branch 'master'.

Have Ratings be gadgets rather than QObjects

Should make the instances much lighter, which is important as there's
tons of them.

M  +2    -4    libdiscover/ReviewsBackend/Rating.cpp
M  +10   -7    libdiscover/ReviewsBackend/Rating.h
M  +5    -1    libdiscover/appstream/OdrsReviewsBackend.cpp
M  +1    -0    libdiscover/appstream/OdrsReviewsBackend.h
M  +5    -1    libdiscover/backends/DummyBackend/DummyReviewsBackend.cpp
M  +1    -0    libdiscover/backends/DummyBackend/DummyReviewsBackend.h
M  +3    -3    libdiscover/backends/KNSBackend/KNSResource.cpp
M  +1    -1    libdiscover/backends/KNSBackend/KNSResource.h
M  +7    -0    libdiscover/resources/AbstractResource.cpp
M  +2    -1    libdiscover/resources/AbstractResource.h
M  +3    -3    libdiscover/resources/ResourcesProxyModel.cpp

https://invent.kde.org/plasma/discover/commit/e5e8ac5f7726a02c44c423fa5828b39e4da75d5e