Skip to content

view: rendering and diff performance on large sheets #2076

Open

Description

@shunichironomura

Warning

This content was written by an AI agent and must be verified by a human developer. After human verification, this alert may be removed.

Found in the review of #2057, which adds the experimental view. It does not block that PR; #2059 fixed the findings that did. Paths refer to #2059's head.

Summary

PR #2059 made the Rust projection linear and stopped it from running for clients that do not use the view. These costs remain on the page:

  • foldToFit in web/view/src/main.ts renders the whole sheet again for every fold it tries.
  • Dragging the split refits on every pointermove and drops the folds the user set by hand.
  • diffModels runs again on every selection change.
  • web/view/src/diff.ts finds the longest common subsequence with an n×m table. Replacing all 25,000 lines of a file inside the 256 KiB limit needs about 2.3 GiB (estimated, not measured). "Copy changes" runs synchronously, so the tab can crash. Use Myers' algorithm, or replace a large changed middle as one block.
  • The qualified rule of tokenize in web/view/src/formula.ts takes quadratic time on a long chain of dots: about 1 s per render at 8,000 segments.
  • Evaluation runs on the main thread and cannot be cancelled. Move it into a worker only after the edit pipeline no longer sends whole-file snapshots (view: apply edits to the latest source instead of whole-file snapshots #2067), and after view: the code pane can replace text the user typed #2066 and view: small state and interaction bugs on the sheet #2075.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    performancewebviewThe experimental view (web/view, graphcal view, graphcal/viewModel)

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions