Skip to content

Improvement: open and close task dialogs in under a second on a 2,000-task board #3974

Closed

Description

@yannickmonney

What should be improved?

Opening and closing a task on a large board. #3948 (for #3939) stops the board from re-rendering on every open and close. On a 2,000-task board, though, a task still takes about 2.1 s to show after the click, and after Escape the page takes about 2.05 s to render its next frame. The manual box TASK-P4 sets a target of < 1 s, and wants the close to end with its exit animation. This issue keeps the four costs that remain tracked once #3939 closes.

Current behavior

The setup: local production builds on a 2-vCPU, 4 GiB sandbox, main @ b5ff70447 against #3948's head @ 856a7c738, with 10 samples a side per size, interleaved. The receipt, with its raw samples and traces, is on #3948. The figures are the head's medians:

50 tasks 350 tasks 2,000 tasks
Task shows after the click (cold open) 526 ms 727 ms 2.11 s
Escape → the page renders without the dialog 422 ms 667 ms 2.05 s

At 2,000 tasks, a screen recording of an Escape close shows the fade ending on screen by ~0.45 s. The next frame comes at ~2.16 s, and until then the page takes no input.

What remains, largest first:

  1. A modal's style recalculation over the whole page. A modal Radix layer sets pointer-events: none on <body>. The property is inherited, so every element recomputes its style. The open forces that twice: first Presence's getComputedStyle, then the dialog's focus(). Measured alone, the change costs 105 ms at 9,324 elements (350 tasks) and 625 ms at 48,199 (2,000 tasks). In the head's traces at 2,000 tasks, style takes 1.62 s of a 2.67 s cold open, and the task's first read starts only ~0.9 s after the click. The cause sits in the design system, so every modal over a large page pays it.
  2. React-query observer bookkeeping. Each card holds ~41 observers: 82,183 on the 2,000-task board, 26,058 of them on current-user. Query keeps a query's observers in an array, so each add or remove scans it. At 2,000 tasks an Escape close keeps the main thread busy for 1.23 s, 1.03 s of it script (traces, n = 3). An earlier CPU profile put ~0.8 s of that close on observer bookkeeping.
  3. The Home panel re-renders on every ?task= change: 488 components on each open and each close.
  4. The dialog's second wave of reads waits for the first. At 350 tasks the activity, comments, labels, dependencies and subscription reads start at ~0.63 s after the click, while the task itself is read from ~0.23 s.

Proposed change

Work on each cost apart. Measure each change on a local production build, before and after, with the same fixtures; #3948's receipt has the harness. These are candidate directions, not decisions:

  • (1) is a design-system question: a modal over a big page should not force a whole-document recalculation.
  • (2) could use fewer observers per card, for example by reading the viewer and session queries once for the board.
  • (3) could keep the Home panel out of ?task= changes.
  • (4) could start the dialog's reads together.

The target stays TASK-P4's. No laptop has been measured against its < 1 s yet; the numbers above come from a constrained VM, not reference hardware.

Affected service

Platform (web app)

Activity

  1. added
    perf
    improvement
    service: platform
    on Sep 30, 2026
  2. yannickmonney commented on Oct 2, 2026

    @yannickmonney
    ContributorAuthor

    Dialog recheck after #4067 (merged as 2a169f4c7), from the TALE-361 performance occurrence of 2026-10-02 11:15 Zurich.

    This harness differs from #3948's receipt:

    • Board: a production build with a synthetic 2,000-task board.
    • Browser and host: Chromium 141, headless, 1440×900, on a sandbox capped at 2 CPUs.
    • Open runs from the click to the frame that shows the task with no busy region left.
    • Close runs from Escape to the frame without the dialog.
    • Comparison: ABBA, n=6 a side.
    2,000 tasks 9b91fb64a (before) 2a169f4c7 (#4067)
    Open 3.15 s (2.80–4.89) 2.83 s (2.67–3.74)
    Close 2.54 s (2.22–3.83) 1.73 s (1.63–2.32)
    • The close gains about 0.8 s. That is item 2: the two shared session queries went from about 30,000 observers each to none. The board still holds 34,084 observers, all on per-card organization reads.
    • Both still miss TASK-P4's target of < 1 s on this host.
    • Items 1, 3 and 4 are unchanged.

    Details and the 50-task check are on #4062.

  3. yannickmonney commented on Oct 5, 2026

    @yannickmonney
    ContributorAuthor

    TALE-361 measurement of this issue's flows after main's 5 Oct perf batch. It uses the same arms, stack and fixture as the #4062 recheck: #4062 (comment)

    How it was measured

    • Flow: on the loaded 2,000-task or 50-task board, click a task's title, then press Escape. Each time it's a different task, taken from the first cards of each lane, which are mounted in both arms.
    • Open: from the click event to the first frame where the dialog shows that task's title, holds its comment box, and has nothing aria-busy.
    • Close: from the Escape keydown to the first frame without the dialog, after its exit animation.
    • Design: ABBA blocks (base, main, main, base), n=8 per arm. The first open after each board load is reported apart (n=2).
    • Host contention: other tenants averaged 0.37–0.39 CPU in both arms.
    Medians with min–max Base e9c6a8fb3 Main 315f216b3 TASK-P4
    2,000 tasks: open 1,894 ms (1,722–2,286) 798 ms (709–865) < 1 s ✅
    2,000 tasks: close 1,708 ms (1,455–1,977) 492 ms (442–774) < 1 s ✅
    2,000 tasks: the first open after the board loads 2,220 ms (2,074–2,367) 1,030 ms (872–1,188) < 1 s: one of two samples over
    2,000 tasks: longest task, open / close 1,504 / 1,084 ms 463 / 214 ms
    2,000 tasks: page elements 56,571 10,073
    50 tasks: open 844 ms (795–1,037) 720 ms (675–790) < 1 s ✅
    50 tasks: close 659 ms (564–766) 488 ms (432–636) < 1 s ✅
    • Limits:
      • The first open after a load also fetches the dialog's code.
      • I didn't trace which of this issue's four costs each commit removed. The page under the modal now holds about 10k elements instead of about 56k, which shrinks the style recalculation in cost 1. The board's react-query observers fell from 34,084 to 1,274 (cost 2).
      • These are a constrained VM's times, not reference hardware.
    • Status: this issue stays open; deciding on it is for the manager and its owner.

    The raw samples and dialog-bench.mjs are in TALE-361's bundle, under occ-20261005T1915/.

  4. added
    agent-ready
    on Oct 29, 2026
  5. tale-code-bot commented on Nov 2, 2026

    @tale-code-bot
    Collaborator

    Where each cost stands (Coder, TALE-46, 2026-11-02)

    TALE-46 works cost (3). The other three landed earlier:

    1. The modal's page-wide style recalculation: f2ce982dc (perf(ui): keep the page out of a modal's pointer isolation), on main. While a modal with an overlay is open, the app root carries pointer-events: auto itself, so the body's pointer-events: none stops there. Its probe measured 0.1 ms instead of 41 ms on a 7,800-element board page.
    2. React-query observer bookkeeping: Bug: a 2,000-task board blocks the tab for 16–26 s when it is searched, left or opened #4062, closed, through 2a169f4c7 (fix(platform): stop subscribing every backend read to the session probe #4067), c5894663e, 6294cd912 and c84217919, all on main. The recheck of 2026-10-05 above counted the board's react-query observers falling from 34,084 to 1,274.
    3. The Home panel rendering again on every ?task= change: TALE-46, branch perf/home-panel-task-param at 5026c3c9313ef623e6d2277fd8efa45ec94d314a on the feature line (feature-train, base faf58a746e82d4f67f88332d5ba7f0e0af84b05a). HomePanel is now memoised and reads only what it shows from the address. A jsdom test wraps the panel in a React Profiler and opens and closes a board's task through a stand-in for the router's location store: without the change it records an update and a nested-update for each, and with it nothing. Each router Link in the panel still re-renders itself when the address changes, as every TanStack Router link does; what it holds does not. The branch's squashed commit carries Closes #3974, so this issue closes when that commit reaches release/0.6 with the feature train.
    4. The dialog's second wave of reads: 113ef5c93 (perf(platform): start a task's own reads together with the task), on main, starts the discussion, dependencies, reviewer and watch-state reads with the task. perf(platform): start a task's activity and run reads with the task #5231 asked the same for the activity and agent-run reads. TALE-315 found they already started with the task, through useLatestRunRefusal at the top of the dialog's body (a29ec1d2b, fix(platform): end the dead ends after a task goes to an agent #4017), and named them in the same prefetch with a test that pins them. Its commit is on feature-train and carries Closes #5231. The label catalog fills only the label picker, which opens on a click.

    Not measured with this change: TASK-P4's timings, since this worker has no backend for a 2,000-task production build. The recheck of 2026-10-05 above measured medians of 798 ms to open and 492 ms to close on the 2,000-task board on main (315f216b3), and 1,030 ms for the first open after the board loads (two samples, 872 and 1,188 ms; that open also fetches the dialog's code).

  6. 17 remaining items

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

    agent-readyimprovementperfservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions