vercel / hyperpower

Hyper particle effects extension
https://hyper.is
MIT License
622 stars 124 forks source link

Unacceptable energy Impact. #19

Open uipoet opened 7 years ago

uipoet commented 7 years ago

I love this plugin's visual effect and morn the loss of it as I've discovered this was the culprit behind a giant energy impact (drained battery on laptop) to hyper. My five-year-old and I eagerly await a new version with a fix!

alexdrans commented 7 years ago

Yeah, wow. Any update on this?

vcfvct commented 7 years ago

Yes, please! Did some more comparison, with the plugin added, the Energy Impact in OSX(10.10.5 Yosemite) activity monitor always shows 30-40 even with 1 tab idle and background. If I remove the plugin and reload, the Energy Impact comes down to 0.1-1 which is just a bit more compare to the native Terminal App.

Looks like I have to get rid of the lovely hyperpower plugin which is hyper in power consumption. 😭

simonmeusel commented 7 years ago

I've experienced the same issue, so it looked into it:

I've created an alternative to hyperpower named hyperboring, it's basically the same, but only shows the particles when in wow mode, else no change is shown. I've fixed the performance issues there, but only if you are out of wow mode.

The issue seems to be the following line:

this._window.requestAnimationFrame(this._drawFrame);

Hyperboring only calls this method when in wow mode, but it should be possible to optimise it everywhere:

When a letter has been typed (_onCursorChange) the method (this._window.requestAnimationFrame(this._drawFrame);) is called every frame until there are no particles left. Then the recursive calls just get stopped until another letter gets typed. This way the CPU will only be used when people are currently typing in hyper.

vcfvct commented 7 years ago

Awesome, @simonmeusel , will u consider to submit a PR to hyperpower to resolve this issue?

simonmeusel commented 7 years ago

Yes, when I find some time :|

simonmeusel commented 7 years ago

See #44