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

Screencast SVG incurs a rendering burden on the browser #1451

Open
ivanreese opened this issue Jun 18, 2024 · 4 comments
Open

Screencast SVG incurs a rendering burden on the browser #1451

ivanreese opened this issue Jun 18, 2024 · 4 comments
Labels
question Further information is requested

Comments

@ivanreese
Copy link

When I load the main repo page in Safari, the screencast SVG renders in a really slow and glitchy way (image below). What's worse, it brings scrolling performance to a crawl (like 2 fps) even when the SVG isn't on screen. Safari struggles to keep up as I scroll down the README, showing large blank sections.

I realize the SVG is smaller than a GIF of the same content — I read the PR discussion about it — but the few dozen KB saved has instead caused a pretty significant amount of layout/paint/compositing work to be done in the browser. (Eg: testing in Chrome, it uses about 50% CPU when the SVG is showing full-window scrolling text). Not sure that's a worthwhile tradeoff, considering the baseline page weight of Github is already around 1MB over the wire, so you're not saving much data, percentage-wise.

I'm on an M1 Pro MBP, so I worry this experience would be even worse for people on less capable hardware.

Anyway, do with this info what you will — I just figure it was worth alerting you to the issue.

CleanShot 2024-06-17 at 19 33 53

@mre
Copy link
Member

mre commented Jun 18, 2024

Hey @ivanreese,

Thanks for the heads-up.

I also have a MacBook M1 (Max, not Pro, but I doubt that matters). The performance is butter-smooth on Firefox and Chrome. I just tried Safari, and I noticed the framerate drops, but I didn't see any artifacts. That's very weird.

Can others comment on this? If it continues to be a problem, I wouldn't mind switching to a video or a GIF.

By the way, the main reason for using SVG wasn't size for me but the fact that glyphs are super sharp at any resolution. I like the crisp look.

@mre mre added the question Further information is requested label Jun 18, 2024
@mre
Copy link
Member

mre commented Oct 8, 2024

@ivanreese, can you still reproduce this? Do you still see artifacts?
Also, if someone else can double-check and report back, that would be great.

@ivanreese
Copy link
Author

I no longer see artifacts, but it still tanks the framerate, especially when I try to scroll, even if the SVG is offscreen. Looking at the Timeline view in dev tools, I'm seeing the CPU hover around 80-90%.

@mre
Copy link
Member

mre commented Oct 10, 2024

Thanks for the feedback. I'll keep this open then. We need to look into how to fix this. Perhaps we can reduce the frame rate of the animation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants