-
Notifications
You must be signed in to change notification settings - Fork 186
Slow performance on mobile #39
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
Comments
Yeah I noticed the same performance issue. I'm wondering if it's because the canvas dimension being too large? Currently it's 1800x400 with DPR=2 (3600x800) even on mobile. Could you try changing it to fit into |
Ah, yeah, that could be. I'm trying to change it, but can't really make sense of the dimension settings. Why does the example set width and height twice? (once via |
@RoberOrz in latest version, you can pass
Because the HTML canvas itself requires width and height to know how many pixels it should render. And then there is CSS width and height to let the browser show it on screen. So in your case And then, because the viewport size can change any time and to always maintain a 2x ratio, you have to add event listeners to |
I'm gonna close this for now as the performance issue is more related to the canvas and webgl itself, not specifically to this lib's code. |
I created a globe on this draft of a new SvelteKit homepage: https://kit-svelte-4iwujf16y-svelte.vercel.app/
When I pull it up on mobile, it makes the page laggy and temporarily locks up my phone. I confirmed with another maintainer who also has a high-end phone.
I think it should be possible as I noticed https://stripe.com/blog/globe works fine on my phone.
I'm not sure if I've done anything obviously wrong. You can see my code here: https://github.com/benmccann/kit/blob/2c2ff26d0c2765571977d46a54602f3b08dc130d/sites/kit.svelte.dev/src/routes/Grow.svelte
The text was updated successfully, but these errors were encountered: