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

CPU consumption #201

Closed
3 tasks done
errge opened this issue May 31, 2021 · 2 comments
Closed
3 tasks done

CPU consumption #201

errge opened this issue May 31, 2021 · 2 comments
Labels
bug Something isn't working duplicate This issue or pull request already exists electron issue Issue of the Electron project, unsolvable in Vieb

Comments

@errge
Copy link
Contributor

errge commented May 31, 2021

Checklist

Describe the bug
Having a new Vieb window with empty profile and without configs idling on vieb://help consumes ~60% CPU, even when the window is not shown (staying on another workspace in X11).

This might be related to #179, but the vieb://help page has no iframes, and also I have no reason to suspect that this is because of my video card (GPU acceleration is correctly enabled according to chrome://gpu).

Different websites consume different amount of CPU, e.g. nilcons.com is only ~5%, but I don't see the reason why can't it be zero when Vieb is not showing at all.

Do you have some links where I could read up on how to profile an electron app? I tried the profiler in internaldevtools, but the result is 99% idle, which is obviously not true. I guess either Vieb or electron behind it is looping in some async/setTimeout stuff...

To Reproduce

Just download the current Linux AppImage build, and open vieb://help only and look at your CPU usage with top.

Specs

  • OS: Debian Linux
  • Version: Tested current git head, and appimage builds back to version 4.0.
@errge errge added the bug Something isn't working label May 31, 2021
@gebner
Copy link
Contributor

gebner commented May 31, 2021

This is probably due to a busy loop checking for iframes, I wanted to clean this up using event handlers, but never got around it.

Here's a quick workaround (that will solve the CPU issue but introduce some delay when following links): gebner@182a052

@Jelmerro Jelmerro added duplicate This issue or pull request already exists electron issue Issue of the Electron project, unsolvable in Vieb labels May 31, 2021
@Jelmerro
Copy link
Owner

This is (as you hinted at) a duplicate of the linked issue. There is an infinite loop inside Vieb to minimize the risks of iframes and make them register clicks and screensharing requests correctly. I explained them in more detail here.

Also, the suggestion of @gebner compromises these features for the duration of the interval you set, this includes showing real values for the battery, memory, cpu APIs, as well as allowing full keyboard access, breaking click actions and screensharing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists electron issue Issue of the Electron project, unsolvable in Vieb
Projects
None yet
Development

No branches or pull requests

3 participants