microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.5k stars 29.39k forks source link

Cache cell output total height #171541

Open rebornix opened 1 year ago

rebornix commented 1 year ago

Currently we only cache cell total height, which is good enough for markup previews and code cells without any output. While exploring #170881 , I found that as long as there are cell outputs, the cell total height cache is invalidated immediately on cell render. What happens is

https://user-images.githubusercontent.com/876920/213004714-66a78c3d-9edd-4413-a380-e711b3050c61.mov

We could consider caching the cell output total height and only recompute the output height after output is rendered.

rebornix commented 1 year ago

With output height cache, we will reserve space for the output that will be rendered:

https://user-images.githubusercontent.com/876920/213004910-6cada27f-ddfd-49cd-b795-e371290837ba.mov