Skip to content

Render-time filesystem probes (canonicalize / exists) run per row on the GPUI thread #154

Closed

Description

@Tryanks

Status — still open (reviewed 2026-08-22)

The broader #155 I/O sweep moved operations that can be offloaded away from the GPUI thread, and chat.rs has since been split into chat/mod.rs + chat/model.rs + components — but the synchronous render-path probes remain on current main (e8a5f1cc).

Current evidence

  • crates/services/src/user_files.rs:5: relativize_to_workspace canonicalizes the workspace root on every call.
  • Render callers: crates/ui/src/chat/model.rs:560, crates/ui/src/chat/components/changed_files.rs:105, crates/ui/src/diff/view.rs:99 and :182, and crates/ui/src/markdown/view.rs:208.
  • crates/ui/src/markdown/link_target.rs:49 still calls path.exists() while resolving relative Markdown-link candidates.

Impact

The calls scale with changed-file rows and Markdown links and can repeat as views rebuild. Local filesystems make the cost easy to miss; network or slow filesystems can turn it into visible frame-time work.

Direction

Cache rather than offload:

  • canonicalize the workspace root once per active cwd/session and pass the resolved root into render models;
  • keep a small document-scoped link-target existence cache, invalidated on document/base-dir changes (or explicitly accept bounded staleness).

Acceptance criteria

  • Rendering changed-file rows and Markdown links performs no filesystem I/O.
  • Cache invalidation is covered when cwd/base directory or Markdown content changes.
  • A render-focused test or instrumentation check prevents these probes from returning.

Effort: S–M · Risk: LOW

Activity

  1. added
    performanceRuntime performance, latency, resource footprint
    on Jul 24, 2026
  2. added a commit that references this issue on Aug 22, 2026
    ed0c019
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

    performanceRuntime performance, latency, resource footprint

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions