Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flashing when pomodoro period is over causing high CPU usage #18

Closed
tabrs opened this issue Feb 8, 2015 · 12 comments
Closed

Flashing when pomodoro period is over causing high CPU usage #18

tabrs opened this issue Feb 8, 2015 · 12 comments

Comments

@tabrs
Copy link

tabrs commented Feb 8, 2015

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

@floatas
Copy link
Collaborator

floatas commented Feb 8, 2015

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

@tabrs
Copy link
Author

tabrs commented Feb 8, 2015

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.

@floatas
Copy link
Collaborator

floatas commented Feb 9, 2015

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.

@tabrs
Copy link
Author

tabrs commented Feb 9, 2015

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.

@floatas
Copy link
Collaborator

floatas commented Feb 9, 2015

Merged my changes to this repository

@tabrs
Copy link
Author

tabrs commented Feb 9, 2015

Will check that soon. Thank you.

@tabrs tabrs changed the title Blinking when pomodoro period is over will cause high CPU usage Flashing after pomodoro period is over causing high CPU usage Feb 9, 2015
@tabrs tabrs changed the title Flashing after pomodoro period is over causing high CPU usage Flashing when pomodoro period is over causing high CPU usage Feb 9, 2015
@tabrs
Copy link
Author

tabrs commented Feb 9, 2015

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.

@floatas
Copy link
Collaborator

floatas commented Feb 9, 2015

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>

@tabrs
Copy link
Author

tabrs commented Feb 9, 2015

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

@lukaszbanasiak
Copy link
Owner

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

@tabrs
Copy link
Author

tabrs commented Feb 10, 2015

For sure ;)

@tabrs
Copy link
Author

tabrs commented Feb 11, 2015

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants