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

fix: use blank page when window isn't active #1198

Merged
merged 1 commit into from
Oct 18, 2019
Merged

Conversation

hacdias
Copy link
Member

@hacdias hacdias commented Oct 18, 2019

This addresses #1196 by changing to a blank page whenever the window is not visible. For this, we use the Page Visibility API.

Requires ipfs/ipfs-webui#1259.

This reduced significantly the CPU usage on my end.

License: MIT
Signed-off-by: Henrique Dias hacdias@gmail.com

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
@autonome
Copy link
Contributor

Looks good! Two questions:

  • How does this impact performance of webui load and render?

  • This feels a bit like giant hammer, without knowing more about the underlying cause of webui chewing cpu. Have you profiled why webui is doing that in the first place? Are there other issues tracking that?

@hacdias
Copy link
Member Author

hacdias commented Oct 18, 2019

How does this impact performance of webui load and render?

It doesn't. We are always on the Web UI, but it's just an empty page.

This feels a bit like giant hammer, without knowing more about the underlying cause of webui chewing cpu. Have you profiled why webui is doing that in the first place? Are there other issues tracking that?

The problem is that we were, by default, on status page. And when we're on the status page, we're continuously fetching repo and bandwidth stats to update the graphs. That creates load on the Web UI and ipfs itself.

Copy link
Member

@lidel lidel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can confirm this works on Linux (opened Status page and closed it):

hidden (without fix)

GPU proces still does something, as reported in #1196:

hidden-without-fix-2019-10-18--20-59-50

hidden (with fix)

Fix seems to work.
GPU process stays at 0%, renderer is at 0% and jumps to 0.7 only every ~5s seconds
(probably when gets status update from HTTP API?)

hidden-with-fix-2019-10-18--20-42-35

@autonome
Copy link
Contributor

The problem is that we were, by default, on status page. And when we're on the status page, we're continuously fetching repo and bandwidth stats to update the graphs. That creates load on the Web UI and ipfs itself.

Can you file a followup issue in webui repo for reducing the cost of having the status page open? You've reduced the cost on desktop in this PR, which is awesome. But if someone leaves the page open in a tab in the browser, they'll still have the problem.

@hacdias
Copy link
Member Author

hacdias commented Oct 18, 2019

@autonome done: ipfs/ipfs-webui#1260!

@hacdias hacdias merged commit f2760c3 into master Oct 18, 2019
@hacdias hacdias deleted the fix/blank-page-bg branch October 18, 2019 20:43
@hacdias hacdias mentioned this pull request Oct 21, 2019
13 tasks
alexhenrie pushed a commit to alexhenrie/ipfs-desktop that referenced this pull request Oct 24, 2019
License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
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

Successfully merging this pull request may close these issues.

3 participants