slidev icon indicating copy to clipboard operation
slidev copied to clipboard

perf: virtual scroll for overview and quick overview

Open jakobkordez opened this issue 1 year ago • 8 comments

Fixes slow loading and scrolling for large presentations

jakobkordez avatar May 24 '24 09:05 jakobkordez

Deploy Preview for slidev ready!

Name Link
Latest commit 9d3d1e0b07228d9b93825b10b62445229453fdac
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.

netlify[bot] avatar May 24 '24 09:05 netlify[bot]

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 avatar May 24 '24 11:05 kermanx

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.

kermanx avatar May 24 '24 13:05 kermanx

Don't merge yet, fixing something

jakobkordez avatar May 24 '24 13:05 jakobkordez

Ok, that's all

jakobkordez avatar May 24 '24 13:05 jakobkordez

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.

antfu avatar May 31 '24 12:05 antfu

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

jakobkordez avatar May 31 '24 13:05 jakobkordez

@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 avatar Jun 03 '24 16:06 jakobkordez