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

Improved Chat / Transcript Virtualization #1088

Merged
merged 29 commits into from
Jan 17, 2025
Merged

Improved Chat / Transcript Virtualization #1088

merged 29 commits into from
Jan 17, 2025

Conversation

dragonstyle
Copy link
Collaborator

@dragonstyle dragonstyle commented Jan 7, 2025

Massive improvement in log viewer performance for large samples. This has a few changes:

  • Much faster json deserialization (for large json blobs) by using transferableObjects rather than copying a string.
  • Virtualize the transcript view
  • Virtualize the chat view

After experimenting with react-window, react-virtualized, and virtuoso, I ended up extending our own virtual list to support dynamic heights and custom scroll parents (the two features we really needed to make this work).

There can be some scroll jitter at very high speed scroll (especially when there is slow loading content like images) as the heights of rows are being computed on the fly. Will experiment with a cache to remedy this.

This PR contains:

  • New features
  • Changes to dev-tools e.g. CI config / github tooling
  • Docs
  • Bug fixes
  • Code refactor

What is the current behavior? (You can also link to an open issue here)

What is the new behavior?

Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)

Other information:

@dragonstyle dragonstyle force-pushed the feature/json-perf branch 7 times, most recently from 8405557 to 9509598 Compare January 10, 2025 20:44
@dragonstyle dragonstyle marked this pull request as ready for review January 17, 2025 14:04
Use a transferableObject to provide the string contents to the web worked to avoid string copying. Very noticeably faster for large json strings.

Json tweak
Some key things:

- The virtual lists don’t perform well with margins along the direction of scrolling (due to size computation), so wrap element in a container with padding to provide margins.

- Adjust css to account for above

- Use the current scrollable region as the scroll parent when computing whether to render items. This required gettings refs from the top level down to the transcript view.l

- Overscan is used to reduce jank in scrolling is items are rendered and their size is computed.
@dragonstyle dragonstyle merged commit d727714 into main Jan 17, 2025
9 checks passed
@dragonstyle dragonstyle deleted the feature/json-perf branch January 17, 2025 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants