Skip to content

Possible perf issue due to unnecessary rendering of outputs when outputs are not visible #207748

@DonJayamanne

Description

@DonJayamanne

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version: N/A
  • OS Version: N/A

Steps to Reproduce:

  1. Install Jupyter Exetnsion
  2. Create a notebook and run a cell with the following code (with a valid png file)
from IPython import display
display.Image("/<path>/output.png")
  1. Copy the above cell along with the output and past this into the same notebook around 10-30 times or more
  2. Close the notebook and re-open it
  3. There are a lot of messages logged in the devtools console window about rendering image mime types (even when all outputs are not visible).
Rendering mimeType image/png Object
renderers.js:2 request Object
renderers.js:2 Rendering mimeType image/png Object
renderers.js:2 request Object
renderers.js:2 Rendering mimeType image/png Object
renderers.js:2 request Object

Note: At this point in time only a few cells are visible

In fact if you create a large code cell to occupy the whole notebook and reload you can still run into this same issue.

This leads me to believe theres a possible perf issue as we're rendering images when we should not.
Hence if we have a notebook with large outputs and a large number of them, then it will freeze or hang vscode.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions