lukaszbanasiak/YAPA

Flashing when pomodoro period is over causing high CPU usage

Closed this issue · 12 comments

My pomodoro period has been over, so I was about to leave my compurer. Pomodoro timer has been flashing. When I was back (after approx. an hour) my laptop fan was pretty active. After checking what's happened I've found out that Pomodoro timer caused very high CPU usage (approx 20-25%). When I've clicked "Stop" button it had fall to approx. 0,5% and then to 0%.

Hi,
Does it happens always when pomodoro is flashing ? And could you give PC specs.

Hi, yes it is happening instantly when it starts to flash. Just to correct it - from 0-1% when running pomodoro period it will raise to 10-20% of CPU when flashing. Spec are not that bad Core i5-3317U, 8GB RAM, SSD drive, Intel HD 4000.

For my laptop CPU was about 5%, reduced flashing animation frame rate to 15, CPU usage dropped to 1-0.5%. If there is still performance issues we could make flashing gif image and use as background.

Hi floatas, is there any commit to a repo so I can try and build it on my own? Or should I modify the source myself? I was about to modify an app slightly anyway - I have some ideas pending so during this week when I have a little time I'll try to get to it.

Merged my changes to this repository

Will check that soon. Thank you.

I can confirm it had improved a lot, even it's still not ideal. My CPU usage falls to 2-7%, with avg. about 4-5%. I personally can live with it now, but it would be better to do some further optimizations. Not sure if a GIF can help you since it has no alpha channels, so the result will look differently.

Not sure how much animations can be optimized. One possible way is to remove red flashing animation and set background to semi transparent red + set taskbar state to indeterminate.

private void StopTicking()
{
    Taskbar.ProgressState = TaskbarItemProgressState.Indeterminate;
....
<Window.TaskbarItemInfo>
        <TaskbarItemInfo x:Name="Taskbar" ProgressState="{Binding ProgressState}" ProgressValue="{Binding ProgressValue}"/>
</Window.TaskbarItemInfo>

I think, this can work way much better. In fact it seems to me as a great idea.
In the end that flashing on top irritates me a bit :-)

In the end that flashing on top irritates me a bit :-)

@tkorcak That's a good sign :) This is just information, after which you should start a new period :)

For sure ;)

I think you can't do any more within current animation solution. I suggest to do only on/off flashing to save CPU usage. So, please consider that and decide whether you can do something about that or not.
Marking this issue as solved since it has improved by reducing the framerate by @floatas. Thanks a lot.