elementary / wingpanel-indicator-datetime

Wingpanel Date & Time Indicator
GNU General Public License v3.0
28 stars 18 forks source link

Performance problem #235

Open Dirli opened 4 years ago

Dirli commented 4 years ago

after adding PR (#232), I noticed a few bugs

  1. when scrolling through months, if you go far enough (for example, in 1999), you notice increased memory consumption

screen1

this is because the array of months is not cleared. after closing the widget, everything remains in memory.

  1. when switching to a new month, a lot of unnecessary actions are performed.

screen2

The calendar model changes 4 times (per iteration), each time it completely redraws everything related to events.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/93683360-performance-problem?utm_campaign=plugin&utm_content=tracker%2F57456330&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F57456330&utm_medium=issues&utm_source=github).
fs3o5 commented 4 years ago
  1. Are you sure this issue is related to this PR? The calendar data is still stored in the same way. The calendar data should probably still be cleared after some time/when closing the widget.

  2. The months are changed so often because the next calendar page needs to be drawn before it is switched to. It might still be a good idea to change that.

Dirli commented 4 years ago

1 carousel is a gtk.container, you fill it (when to switch new months for a long time), but you don't remove it from it. when closing, nothing is cleared on its own 2 it's not your problem, you're singleton's hostage, need to change the calendar_model. you can't use singleton anymore (it's better not to use it at all)