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

CellOutputMimeTypeTracker is very inefficient #12599

Closed
r3m0t opened this issue Jan 21, 2023 · 1 comment
Closed

CellOutputMimeTypeTracker is very inefficient #12599

r3m0t opened this issue Jan 21, 2023 · 1 comment
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug

Comments

@r3m0t
Copy link
Contributor

r3m0t commented Jan 21, 2023

Environment data

  • VS Code version: Version: 1.75.0-insider (user setup)
    Commit: a0562ccdb202a29ac35da81c2b5482e517158f32
    Date: 2023-01-18T08:54:05.566Z
    Electron: 19.1.9
    Chromium: 102.0.5005.194
    Node.js: 16.14.2
    V8: 10.2.154.23-electron.0
    OS: Windows_NT x64 10.0.19044
    Sandboxed: Yes

  • Jupyter Extension version (available under the Extensions sidebar): 2022.08.100 (sorry)

  • Python Extension version (available under the Extensions sidebar): 2022.20.2

  • OS (Windows | Mac | Linux distro) and version: Win

  • Python and/or Anaconda version: 3.10

  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A

  • Jupyter server running: default local

Steps to reproduce:

[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]

I was just debugging microsoft/vscode#168142 and I used this minimal example to examine the case of streaming output:

import time
print('Zi3')
time.sleep(10)
print('Z24ihi')

It looks like the behaviour is very N^2 (calling replaceOutputItems with the full text to append stdout to an existing cell) but I also noticed this really suspicious call stack:

image

The telemetry is only interested in the cell output_type:

https://github.com/microsoft/vscode-jupyter/blob/2022.08.100/src/kernels/jupyter/jupyterCellOutputMimeTypeTracker.node.ts#L82-L108

However, it's actually running line splitting on the entire output:

https://github.com/microsoft/vscode-jupyter/blob/2022.08.100/src/kernels/execution/helpers.ts#L466-L485

Logs

None

@r3m0t r3m0t added the bug Issue identified by VS Code Team member as probable bug label Jan 21, 2023
@r3m0t
Copy link
Contributor Author

r3m0t commented Jan 21, 2023

Oops. Should have checked main branch ;)

@r3m0t r3m0t closed this as completed Jan 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

2 participants