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

perf: virtual scroll for overview and quick overview #1610

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

jakobkordez
Copy link
Contributor

Fixes slow loading and scrolling for large presentations

Copy link

netlify bot commented May 24, 2024

Deploy Preview for slidev ready!

Name Link
🔨 Latest commit 9d3d1e0
🔍 Latest deploy log https://app.netlify.com/sites/slidev/deploys/66fd770d0951ef0008b4f6cf
😎 Deploy Preview https://deploy-preview-1610--slidev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@KermanX
Copy link
Member

KermanX commented May 24, 2024

Thanks for your contribution!

There is a problem that the height of the rows is calculated dynamically, but the itemHeight given to useVirtualList is a static value. I am not very sure on this.

@KermanX
Copy link
Member

KermanX commented May 24, 2024

There is a problem that the height of the rows is calculated dynamically, but the itemHeight given to useVirtualList is a static value. I am not very sure on this.

Fixed.

@jakobkordez
Copy link
Contributor Author

Don't merge yet, fixing something

@jakobkordez
Copy link
Contributor Author

Ok, that's all

@KermanX KermanX changed the title Add virtual scroll for overview and quick overview perf: virtual scroll for overview and quick overview May 28, 2024
@antfu
Copy link
Member

antfu commented May 31, 2024

I am not very sure about this - after this PR, every time you open up the overview, every slide gets re-initiated, which they are supposed to be cached.

If perf/memory is really a concern, I'd suggest we take a screenshot of the final slide and place the overview with that image (with an option to opt-in/out) so we don't duplicate slides rendering and would be a lot more performant than virtual scroll.

@jakobkordez
Copy link
Contributor Author

If you need a large presentation for testing try: https://gitlab.vegova.si/rkv/prosojnice

@jakobkordez
Copy link
Contributor Author

@antfu Are you sure the slides are not getting cached? It seems to me they are: the loading component only shows the first time the page is opened

@jakobkordez jakobkordez marked this pull request as draft October 2, 2024 16:39
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