Skip to content

perf(desktop): reduce session-switch latency for active sessions #5627

Description

@me2seeks

What happened

Switching between Desktop sessions feels noticeably slow when the destination session is actively generating a response, especially when it is backed by a remote Runtime Host. In one instrumented development run, the previous transcript remained visible for about 1.5 seconds, new transcript rows began appearing around 2 seconds after selection, and the view settled after roughly 5 seconds. The sampling was approximate (about 200 ms), and this is an observation from one dev session, not a production benchmark.

A read-only replay of the transcript paging path against an isolated database copy took about 260 ms for a larger active-session sample. That makes SQLite alone an unlikely explanation for the full observed delay, but it does not identify the actual bottleneck: Runtime Host transport, Main/Renderer IPC, React work, streaming updates, and development-mode overhead still need to be measured separately.

How to reproduce

  1. Run Maka Desktop from source in development mode.
  2. Start a response in a session hosted by a remote Runtime Host and let it continue generating.
  3. Select another session, then switch back to the still-running session.
  4. Observe the delay before the selected session's transcript appears and becomes stable. Compare with switching to an idle session.

The delay was readily noticeable in the observed run. Packaged-build behavior has not yet been verified.

Environment

  • Maka version or commit: b004473ed (from source)
  • OS: Windows 11 with WSL2-backed remote Runtime Host
  • Surface: Desktop
  • Node.js: v26.2.0 (Windows dev process)
  • Mode: npm run dev (Electron 43 / Chromium 150)

Logs, screenshots, or additional context

No session names, transcript content, local paths, credentials, or account identifiers are included. The timings above are approximate and were collected with renderer instrumentation; instrumentation and dev mode may affect results. Please profile the switch in stages (selection/loading feedback, transcript-open response, IPC delivery, first paint, and stable render) and compare against a packaged build before assigning a root cause.

Related broader incremental-transcript work: #2913. This report is specifically about the user-visible latency when switching to an active session; it does not assume a particular implementation or duplicate the broader tracker.

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions