[Differential] [Commented On] D3837: [Calendar] Optimize Backend

davidedmundson (David Edmundson) noreply at phabricator.kde.org
Wed Dec 28 15:30:45 UTC 2016


davidedmundson added a comment.


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

INLINE COMMENTS

> calendar.cpp:319-323
> +    if (needsModelReset) {
> +        m_daysModel->update(DaysModel::UpdateType::ModelReset);
> +    } else {
> +        m_daysModel->update(DaysModel::UpdateType::DataChanged);
> +    }

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.

REPOSITORY
  R242 Plasma Frameworks

REVISION DETAIL
  https://phabricator.kde.org/D3837

EMAIL PREFERENCES
  https://phabricator.kde.org/settings/panel/emailpreferences/

To: broulik, #plasma
Cc: davidedmundson, plasma-devel, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20161228/115d3302/attachment.html>


More information about the Plasma-devel mailing list