[Calendar] Optimize Backend
AbandonedPublic

Authored by broulik on Dec 28 2016, 2:43 PM.

Details

Reviewers
davidedmundson
Group Reviewers
Plasma
Summary
  • Use QQmlParserStatus to avoid premature initialization
  • Requires the days model to signal a model reset as by the time the Repeater in QML read the model for the first time it's empty (avoids boolean trap in "update" method signature by using an enum ;)
  • Don't signal weeks"Model" changed if it didn't - emitting a changing variant list / json array will cause QML to destroy and re-create all delegates
Test Plan

Calendar still seems to work. Week number column still works.

Unfortunately did not result in a noticeable speedup of first invocation

Diff Detail

Repository
R242 Plasma Framework (Library)
Lint
Lint Skipped
Unit
Unit Tests Skipped
broulik updated this revision to Diff 9418.Dec 28 2016, 2:43 PM
broulik retitled this revision from to [Calendar] Optimize Backend.
broulik updated this object.
broulik edited the test plan for this revision. (Show Details)
broulik added a reviewer: Plasma.
broulik set the repository for this revision to R242 Plasma Framework (Library).
Restricted Application added a project: Plasma. · View Herald TranscriptDec 28 2016, 2:43 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript

Unfortunately did not result in a noticeable speedup of first invocation

You've said this in two requests now. Whare are you using to profile?

src/declarativeimports/calendar/calendar.cpp
319–323

We can simplify this:

if (needsModelReset) {

daysModel->setSourceData(m_daysList)

} else {

daysModel->update();

}

No need to change DaysModel (except maybe to remove the setSourceData) check.

...or create 42 items in the ctor.
...or set DaysModel::rowCount to always return 42 and this always call update()

Currently DaysModel has two update methods, one for changing the list, another for updates of the existing list.

This is exlicitly setting it to a list of 0 items, then adding a third way of updating to handle the list being actually initialised, and one of those 3 things is clearly pointless.

davidedmundson requested changes to this revision.Apr 24 2018, 2:45 PM

marking as request changes based on my comments

This revision now requires changes to proceed.Apr 24 2018, 2:45 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptApr 24 2018, 2:45 PM
Restricted Application added a subscriber: Frameworks. · View Herald Transcript
broulik abandoned this revision.May 25 2018, 8:42 AM
Restricted Application edited subscribers, added: kde-frameworks-devel; removed: Frameworks. · View Herald TranscriptMay 25 2018, 8:42 AM