Bug 431364

Summary: Lots of Rating objects are created
Product: [Applications] Discover Reporter: David Edmundson <kde>
Component: discoverAssignee: Dan Leinir Turthra Jensen <leinir>
Severity: normal CC: aleixpol, nate
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 5.21

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
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