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

/bg.svg murders performance #1039

Open
uhidontkno opened this issue Dec 25, 2024 · 12 comments · Fixed by #1073
Open

/bg.svg murders performance #1039

uhidontkno opened this issue Dec 25, 2024 · 12 comments · Fixed by #1073
Assignees

Comments

@uhidontkno
Copy link

Decided to add it to my project and the video speaks for itself. This explains why the site is laggy as hell on mobile. Solution: Just use a PNG.

Screencast_20241224_203503.mp4

By the way, the video is 30fps, not 5.

@genericness
Copy link

if this is actually an issue, consider webp? pretty sure thats the fastest image format on web browsers

@uhidontkno
Copy link
Author

uhidontkno commented Dec 25, 2024

png, webp, avif, jpg, whatever. they're all better than a svg with a gazillion <path>s

@genericness
Copy link

genericness commented Dec 25, 2024

if anyone would like to try a webp, i converted the bg.svg, download is here: https://www.mediafire.com/file/zsjjaqp2i3uayye/bg.webp/file

sorry about mediafire link, github doesnt allow webp uploads

@uhidontkno
Copy link
Author

can you like use literally anything but mediafire
Image

anyway here's a png ver
image

@Gitstar-OC
Copy link
Contributor

Alright, I don't think that it is going to solve the things completely as bg.svg is not the only issue but other things and packages that we are using along with it like framer motion, multiple number of svgs / pngs etc and this uses a lot of memory along with various other things.

While I have also noticed this problem I am going to try it first in the local environment and if that works I will make a pr to change bg.svg with bg.png if that's what you like to get added.

@Gitstar-OC Gitstar-OC self-assigned this Dec 25, 2024
@uhidontkno
Copy link
Author

i did go into devtools and override /bg.svg with a blank svg file and i did notice a performance increase

@uhidontkno
Copy link
Author

Screencast_20241225_110400.mp4

@Gitstar-OC
Copy link
Contributor

Well I also noticed it when I removed the bg.svg file but I think the overall issue is because that we are using an image as a background. Using bg.png instead of bg.svg will not increase the performance by a lot of percentages as most of the things will stay same. The blank svg did it because there are no clip paths in the file (as svg files are rendered with the help of browsers and are hard to open in gallery.

Please let me know any other alternative you think of `

@maxwofford
Copy link
Member

Can someone submit a PR that swaps out the SVG with a WEBP & png fallback?

@Gitstar-OC
Copy link
Contributor

Sure, on it!

@maxwofford
Copy link
Member

I'm reopening this because it didn't add webp! I like that the PNG there though

@maxwofford maxwofford reopened this Jan 7, 2025
@Gitstar-OC
Copy link
Contributor

Gitstar-OC commented Jan 8, 2025

Sure, I will also update with a webP

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 a pull request may close this issue.

4 participants