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

Test: large notebook output performance #188699

Closed
3 tasks done
amunger opened this issue Jul 24, 2023 · 1 comment
Closed
3 tasks done

Test: large notebook output performance #188699

amunger opened this issue Jul 24, 2023 · 1 comment

Comments

@amunger
Copy link
Contributor

amunger commented Jul 24, 2023

Refs: #182636

Complexity: 3

Create Issue


Summary

We made some performance improvements for scrollable notebook outputs with large amounts of streaming output while a cell is being executed by appending to the DOM rather than replacing large amounts of elements. All other behavior should remain the same.

Setup (If you don't have python set up to run notebooks)

  1. ensure python is installed on your machine
  2. open a workspace where you will be running tests for this TPI
  3. Create: new jupyter notebook and run print(1) in a cell.
    a. If the cell runs successfully, you're already set up,
    b. otherwise select "change kernel" in the pop-up that informs you about missing packages (unless the kernel picker opened in the quick pick, then just go to step 4)
  4. The kernel picker should open, select "Python Environments..." -> "Create Python Environment..." and select the base interpreter to use
    a. All necessary packages should be installed and the cell should run successfully

Testing

  1. ensure "notebook.output.scrolling": true
  2. Run some cells that will force a lot of rendering actions to happen quickly, which can be done by making a flush call to push the updated output content to the renderer. Pushing the numbers too high will still cause slowdowns, but should still be improved. examples:

Lots of rendering

import sys
for i in range(5000):
    print('{!r} {!r}'.format(list(range(10)), i), file=sys.stderr)
    sys.stderr.flush()

Lots of previous data per render

for i in range(300000):
    print('{!r} {!r}'.format(list(range(10)), i), file=sys.stderr)

import sys
for i in range(100):
    print('{!r} {!r}'.format(list(range(10)), i), file=sys.stderr)
    sys.stderr.flush()

Lots of new data per render

This one is still pretty slow since it still often needs to replace a large amount DOM structure

import sys
itr = 0
for i in range(10):
    for j in range(4444):
        itr = itr +1
        print('{!r} {!r} {!r}'.format(itr, j, i), file=sys.stderr)
    sys.stderr.flush()
@vscodenpa vscodenpa added this to the July 2023 milestone Jul 24, 2023
@ghost ghost assigned isidorn, Yoyokrazy and ulugbekna Jul 25, 2023
@ulugbekna ulugbekna removed their assignment Jul 25, 2023
@ulugbekna
Copy link
Contributor

worked quite fast for me, cool work!

@isidorn isidorn removed their assignment Jul 25, 2023
@Yoyokrazy Yoyokrazy removed their assignment Jul 25, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Sep 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants