dart-lang / sample-pop_pop_win

"Pop, Pop, Win!" is an implementation of Minesweeper in Dart.

Home Page:https://dart-lang.github.io/sample-pop_pop_win/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CPU hog

vinsci opened this issue · comments

This program is continuously a CPU hog for no good reason, both before a game is started, during the game as well as afterwards. Perhaps this is a problem with how StageXL is used: a quick profiling put requestAnimationFrame() at the top of the list, or a problem with StageXL itself, if it can't be used without hogging the CPU.

As a Dart example, this bad behavior risks spreading to many web apps unless corrected, leading to degraded device performance and energy waste.

Switching to another tab ends the CPU hogging.

Thanks for pointing this out!

I'm pretty sure it's the timer – we update every 10th of a second. I bet there is work we could do to improve this.

...or just update once a second until you complete?

Will keep this in mind.