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

[performance] Poor performance and scroll stuttering on landing page from Globe #42

Closed
shelwinsunga opened this issue May 23, 2024 · 17 comments

Comments

@shelwinsunga
Copy link

A lot of complaints regarding intensive gpu usage that damages UX and first impressions. This is especially prominent on non-MacOS devices. On my windows laptop, roughly 100% of my GPU is being used on the front page.

A preliminary inspection I conducted showed that the Globe, cobe, is really resource intensive. I haven't done much profiling besides that, but you'd wanna see if the following options are viable:

  • Basic performance optimizations: simplifying the shader, reduce vertices, limit framerate
  • Conditionally load the Globe(s) based on the client's device capability
  • Use WebGPU rather than WebGL?
  • Stop the animations that aren't in view
@itsarghyadas
Copy link
Collaborator

@shelwinsunga Yes, we would love to make it more performant for all devices, and those are some excellent improvement points you've mentioned.

Please let us know if you have any more suggestions or if you'd like to help us implement this approach. If you want you can join our discord group.

Thank you,
Arghya

@BankkRoll
Copy link
Contributor

Yeah same im not even able to load the landing page or the bento grid, seems to make my pc freeze almost completely. I think the biggest issue is "Globe" looking thru docs seems globe was at fault on my end as well.. Would get this changed asap as the landing page is not even usable on my end.

NewTab-GoogleChrome2024-05-2511-28-29-ezgif.com-crop-video.mp4

@dillionverma
Copy link
Collaborator

Also want to link this related issue as well

shuding/cobe#78

@dillionverma
Copy link
Collaborator

From my preliminary evaluation, it looks like cobe has performance issues that need to be resolved and they are being carried upstream into this library.

We can resolve this issue by solving the core underlying issue, or just removing it from magicui.

Resolving the core underlying issue is preferred but will take time

Here's a simple + fast plan of action that can be done in the next few hours.

Possible Next Steps

  1. Remove globe demo from landing page bento grid and landing page. Replace with a different demo.
  2. Add a performance warning indicator on the globe docs here https://magicui.design/docs/components/globe so people are aware that the globe has performance issues

Let me know if you have any other suggestions

@BankkRoll
Copy link
Contributor

BankkRoll commented May 25, 2024

Yeah found those issues checking myself as well into cobe. I think its best as you suggested, remove from the landing page so eyes can still get on your great project without performance issues! And making some performance callout would be great!

Another spot is here in the docs the bento grid, not able to checkout as is super intensive there as well.

p.s 🚀 great components!

@dillionverma dillionverma changed the title [performance] Poor performance and scroll stuttering on landing page [performance] Poor performance and scroll stuttering on landing page from Globe May 26, 2024
@dillionverma
Copy link
Collaborator

Pushed performance fix heree!

a61ab0f

Can someone confirm if its faster yet?

@itsarghyadas
Copy link
Collaborator

@dillionverma Yes, on my system, both my phone and PC feel much faster. To make it load even faster, you might consider stopping the animation of the hero headline and other elements. However, I think it's good to go. Let's hear from others as well.

@dillionverma
Copy link
Collaborator

sounds good! closing for now, please let me know if theres any other issues which pop up relating to this

@BankkRoll
Copy link
Contributor

Tested all areas of performance issues. Super fast load times now! 🚀

@dancrump1
Copy link

Agreed, site is much more performant on my wimpy work computer.

@andrewdoro
Copy link

andrewdoro commented Jun 7, 2024

https://ui.aceternity.com/components/github-globe not sure if this is a better option, it's using react three fiber instead of cobe

@BankkRoll
Copy link
Contributor

https://ui.aceternity.com/components/github-globe not sure if this is a better option, it's using react three fiber instead of cobe

+1

Runs little heavy but loads instantly and 90% smoother then the current globe fosure!

@alamenai
Copy link
Contributor

How GitHub made it !

@Abdulali97
Copy link

@alamenai they don't use any texture! , thy use light only to draw earth region.

here is a blog about how they made it
https://github.blog/2020-12-21-how-we-built-the-github-globe/

@khalidx
Copy link

khalidx commented Sep 4, 2024

FYI, if this is resolved, this content may need to be removed from the documentation:

Page: https://magicui.design/docs/components/globe

Content:

⚠️ Warning
The globe has known performance issues causing computer GPU and CPU to spike. See [here](https://github.com/magicuidesign/magicui/issues/42) for more details.

@omarfarukee
Copy link

this is my first time i am using this magical ui library , when i 1st time look on the the golbe it was just wow , but when i was implement that globe, my hole website animation was like slowly moveing😥💔, but i wish this problem will be sloved soon.

@FollowNaim
Copy link

While the globe component is in view, it will render as expected. When it's out of view, it will be destroyed immediately.
This approach helps mitigate the issue of the globe running continuously in the background, which can cause performance issues and potentially freeze your PC.
Although there are still a few bugs to address, this solution is a significant improvement over constant background rendering.

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

No branches or pull requests