Hyper: constant CPU and "Energy Impact" usage on macOS Sierra

Created on 28 Jul 2016  路  47Comments  路  Source: vercel/hyper

Hi. I'm always getting this even with a single empty and silent tab opened:

screen shot 1

screen shot 2

plugins: ['hyperterm-atom-dark', 'hyperterm-subpixel-antialiased']

Other electron-based apps on my machine like Atom in idle mode are barely noticeable in Activity Monitor top rows, so I don't think that this issue is related to macOS Sierra Public Beta which I use. Any thoughts?

help wanted Performance

Most helpful comment

I think most people who've stopped by to report this issue _weren't_ using the hyperpower plugin. I, for one, wasn't. So let's not chase that rabbit hole, thinking it's the root cause.

All 47 comments

Coming right under chrome. reproducable for me
screen shot 2016-07-31 at 1 48 07 am

Reproducible. With 1 empty tab in focus:

3% to 7% CPU usage
2.7 energy impact.

Using El Capitan

+1

With one idle tab open:
screen shot 2016-11-02 at 2 00 39 pm

Seems related to issues in #574

FWIW I only saw this when using zsh.

I can reproduce this as well (one idle tab):
hyper

Can confirm @developit's comment. My experience occurred while using ZSH. But that's all I use, so I can't compare against a non-ZSH env.

@marclundgren Oh My ZSH

I have this problem too on Mac OS sierra 10.12.1
screenshot

@obrassard are you using any ZSH addons? hyperzsh, antigen, oh-my-zsh, zgen?

@marclundgren No, the only plugins I am using are "hyperpower", and "hyper-blink"

@obrassard oh, I don't mean hyper addons. Are you using any of these? https://github.com/zeit/hyper/issues/474#issuecomment-265245256

@marclundgren Not to my knowledge but were can I verify just for sure ?

I too meet this problem with only 1 empty tab in focus:

screenshot 2016-12-13 22 42 15

macOS Sierra 10.12.1
Hyper 1.0.0

Also experiencing this with only 1 empty tab
screen shot 2016-12-28 at 12 06 34 pm

+1, reproducible here too. No significant difference for me between zsh and bash, hyper drains my battery at a rate of about 5% a minute (!!) either way.

screen shot 2017-02-21 at 9 48 34 pm

@rauchg @CodeTheory @leo Someone please remove the Can't Reproduce tag please, I think that jumped to the conclusion too soon.

The readings fluctuate a bit but on average Hyper indeed is using way more resources comparing with iTerm2:

CPU
http://i.imgur.com/6ZQ5Y78.png

Energy
http://i.imgur.com/KMRen4t.png

and @gsklee do you have any hyper plugins running? also which version?

@marclundgren freshly installed v1.2.1

On mine it's even worse, it goes above 50 on energy impact and I've got 23 avg for a 8 hour use (chrome was around 18!). MacOS Sierra and some plugins (hyperpower, hyperterm-close-on-left, hyperlayout, hyperterm-ayu). Are we getting somewhere here?

@henriqueioneda can you take measurements again but with no plugins installed?

Without the plugins, it is about 13 energy impact while I'm in it (sometimes when I enter and leave directories it has peaks of 20~30). For the 8 hour average I'd have to wait more, but I guess its about it. I installed the plugins one by one, and it seems hyperpower is the most impactant (makes energy impact go over 50), and the others seem to have little to no impact (except maybe for the theme hyperterm-ayu which raises it by 5, I guess). I guess I'll just stop using hyperpower =(

I've had to disable hyperpower too for the same reason. Really sad, it was such a fun feature..

I think most people who've stopped by to report this issue _weren't_ using the hyperpower plugin. I, for one, wasn't. So let's not chase that rabbit hole, thinking it's the root cause.

I support @lukeed on his theory.
I for one wasn't using any plugins and now my plugins are hyperterm-atom-dark (which is a theme) and hyperlinks. And this hasn't change my energy impacts

It actually uses more than the IDE(Intellij) which compiles stuff and run app servers all the time.
Please investigate.
I only have 2 plugin:

 plugins: [
        'hyper-solarized-dark',
        'hyperpower'
  ],

hyper-drain

@vcfvct Turn off hyperpower for starters. The way it works _certainly_ increases CPU, energy, and mem usage. We're trying to track Hyper (alone).

I think it's important that whoever is experiencing this opens the Dev Tools to see if it's _actually Hyper_. Keep in mind that other than auto updates, Hyper should be idle most of the time (unless you're constantly streaming something to a terminal). It's no different from any other React webapp.

And by _actually Hyper_ I mean: I want to make sure that the energy impact is not being obtained from the child processes spawned by the ptys started by Hyper (e.g: that it's measuring any CLI program you launched or are working with)

@rauchg Yeah, for me it was Hyper. Here's when I pinned down that it was, in fact, just Hyper & nothing else affecting.

I believe that it probably all comes down to Electron. I read somewhere recently that VSCode was having similar, unexplained energy/CPU impacts, and someone was able to trace it down to a blinking cursor...which ended up being an Electron-responsible behavior.

Found the reference: https://github.com/Microsoft/vscode/issues/22900

@rauchg Yes, I did not run any cli/ssh/other nodejs script in the hyper. Just ONE idle tab in my home(~/).
After I have 2 hours meeting I found my batter dropped to 20%, which usually last for 6-7 hours. That's why I open activity manager and found this issue. The shell I use is Fish which I do not think matters since it is the shell I have long before using hyper.js.
@lukeed As for the hyperpower, i do not want to get rid of since it really makes the terminal fun to use. Hopefully there will be a solution....

Did some more comparison, i can almost confirm the problem is from the fancy/good-looking hyperpower plugin. 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. 馃槶

Note that this is different but similar to what VS Code was seeing. In VS Code it's related to a 1 second CSS animation being evaluated every frame, here it's firing the animation frame callback every frame and redrawing.

If this is indeed the cause, you should try only drawing the frame in hyperpower only when there are particles to draw. Right now this https://github.com/zeit/hyperpower/blob/8853a1852721e377179347d01d624214adcbd26a/index.js#L149 runs every animation frame, meaning on every frame with 0 particles, a callback is fired which clears the context and a new one is registered.

Instead you should only request the next frame when there are > 0 particles and fire a new one when particles are created. Essentially what I did here for xterm.js https://github.com/sourcelair/xterm.js/pull/521

I'm interested to hear any solutions you find :)

I'm having the same issue, 3 tabs open, one of them is running Laravel Elixir's gulp watch.

My machine is fairly new. Only plugin I have is hyperterm-cobalt2-theme.

screen shot 2017-07-07 at 12 36 46 pm

@andfelzapata expanding Hyper might give some useful details on the sub-processes there.

I can confirm this bug with version 1.3.3.1754.

screen shot

In windows Hyper drains battery really fast...
hyper

@fengwang do you have some plugin installed that's running netstat? It looks like that is a big reason for your case.

Comfirm HyperPower problem :
With hyperpower : 1 Tab in Idle Mode -> 46 energy impact
Without hyperpower ( but no more funny ) : 1 Tab in Idle Mode -> 3 energy impact

I have the same issue. I opened Hyper and then left it there. Only changed directories once then left it. It's been sitting there for several hours, and it's saying it's using significant energy. Here's my activity monitor:

screen shot 2018-01-12 at 1 31 53 pm

I don't have any plugins installed except a theme. Any work being done on this issue?

Guys, hyperpower is 100% going to increase energy impact. It's mounting a requestAnimationFrame listener which looks for something to do _every frame_ — that's what it's supposed to do.

This issue/thread isn't for hyperpower 馃槄

Let's try to keep it clear for hyper resource usage directly.

_Commented because I'm still subbed to this thread, and most every email I get about this issue mentions hyperpower lol_

Agreed. I'm referring specifically to hyper itself in my comment above.

@jbw91 can you give me your Hyper Version?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

0x80 picture 0x80  路  45Comments

silvenon picture silvenon  路  94Comments

indutny picture indutny  路  46Comments

cristian-sima picture cristian-sima  路  51Comments

rauchg picture rauchg  路  67Comments