Skip to content

[Bug] Switching to a tab with a large table takes seconds since 0.20+ (regression from 0.17.1) #5829

Closed

Description

@mbrettschneider

Description

  • Version: v0.23.0 and v0.22.0 (AppImage, Electron 42.1.0); compared against v0.17.1 (AppImage, Electron 15.4.0)

  • OS: Ubuntu 24.04.5 LTS, GNOME 46, Wayland, fractional scaling 112.5 %

  • Issue Description:
    Switching to a tab that holds a document with large tables blocks the UI for several seconds. Clicks on other tabs appear to do nothing until the render finishes. In 0.17.1 the same switch was under one second. Switching away from the large document is fast, and small documents switch quickly in both versions. It looks as if the document is fully re-rendered on every tab activation instead of being kept or cached.

    This is related to, but not the same as, Improve performance with large files #3640 (large-file performance) and [Linux] Opening large documents is very slow in v0.20.0-rc.1 #5115 (opening large documents). Those cover the initial open; this one is about every tab switch after the file is already open.

Steps to Reproduce

  1. Generate large-table.md with the script below (482 lines: four sections with 115-row, six-column tables; each row contains one link).
  2. Open large-table.md and a small small.md in one window.
  3. Switch from small.md to large-table.md by clicking its tab.
import random
random.seed(1)
L = ["# Large table test\n"]
for s in range(4):
    L.append(f"\n## Section {s+1}\n\n| # | Item | Owner | Reviewer | Date | Status |\n|---:|---|---|---|---|---|")
    for i in range(115):
        n = s*115 + i + 1
        L.append(f"| {n} | [repo-{n%40}#{1000+n}](https://example.com/repo-{n%40}/pull/{1000+n}) feat: change number {n} with some descriptive text | user{n%23} | user{(n*7)%23} | 2026-10-{1+n%20:02d} | {'merged' if n%3 else 'open'} |")
open("large-table.md", "w").write("\n".join(L) + "\n")

Expected Behavior

Switching to an already-open document is about as fast as in 0.17.1 (well under a second).

Actual Behavior

Measured from a tab click (dispatched on the tab element) until the tab is active and two animation frames have been painted, using separate fresh profiles (--user-data-dir) for each version on the same machine:

Switch to v0.17.1 v0.22.0 v0.23.0
large-table.md (≈12,000 DOM nodes) 0.51 s 3.02 s 3.09–3.24 s
small.md 0.08–0.10 s 0.05 s 0.05 s

With a real-world document of about 450 table rows (≈19,000 DOM nodes) the difference is 0.7–0.9 s (v0.17.1) against 9.5 s (v0.22.0) and 8.2–8.5 s (v0.23.0).

During the delay the window does not respond to further clicks, so tab switching feels broken.

Activity

  1. Jocs commented on Oct 21, 2026

    @Jocs
    Member

    Chould you please paste a demo document to help fix this issue.

  2. added
    🚧 needs triage
    on Oct 21, 2026
  3. mbrettschneider commented on Oct 21, 2026

    @mbrettschneider
    Author

    I built #4942 locally and it fixes this.

    Both builds were made with electron-vite build from source on the same machine: the PR head 523e128b and its merge base on develop, 3e9e91c2. The test is the same as above: switch from small.md to large-table.md (generator script in the issue description), with a fresh profile (--user-data-dir) per run, three runs each:

    Switch to large-table.md (≈12,000 DOM nodes) Time
    v0.17.1 (release) 0.51 s
    merge base 3e9e91c2 2.97–3.10 s
    #4942 head 523e128b 0.31–0.43 s
    v0.23.0 (release) 3.09–3.24 s

    The document renders completely in both builds (same DOM node count), so the PR doesn't speed things up by rendering less. With the real-world document mentioned above (≈19,000 nodes), the PR build switches in 0.56–0.59 s, against 8.2–8.5 s in v0.23.0.

    This also supports the idea that the cost is superlinear. In v0.23.0, 1.56× the nodes took 2.7× as long, which matches the repeated reference-definition collection and token-walk concatenation that #4942 removes. #4946 (progressive mounting) does not seem to be needed for this case.

    It would be great to see #4942 in the next release.

  4. Jocs commented on Oct 26, 2026

    @Jocs
    Member

    Fixed by #4942, merged into develop. Thanks for verifying the fix and sharing the benchmarks! This will be included in the next release.

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

    🚧 needs triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions