Skip to content

WSL repos are 10-20x slower than native Windows repos due to 9P filesystem boundary #22044

Open

Description

@coleleavitt

The problem

Repositories stored on WSL filesystems (\\wsl.localhost\ or \\wsl$\) are 10-20x slower than native Windows repos for every git operation. This is because Desktop uses Windows git.exe which accesses WSL files through the 9P protocol filesystem bridge — every file read/write crosses the VM boundary.

Measured timings on a ~500 file WSL repo:

Operation Current (Windows git via 9P) Expected (native git)
git status 2-6s 100-300ms
git log 1-4s 50-200ms
git diff 1-3s 50-150ms
git fetch 3-10s 1-3s

This makes Desktop essentially unusable for the common workflow of storing repos on the WSL filesystem for ext4 performance while using Desktop on Windows.

Proposed solution

Route safe git subcommands through wsl.exe -e git when the repository path is detected as a WSL path. WSL-native git operates directly on the ext4 filesystem, bypassing the 9P boundary entirely.

Safe subcommands (read-only, no hooks/credentials needed): status, log, diff, branch, checkout, for-each-ref, rev-list, rev-parse, show, tag, stash, config, remote, merge-base, fetch, ls-remote, etc.

Unsafe subcommands that must stay on Windows git (need trampoline/hooks): commit, push, pull, merge, clone.

I have a working implementation with tests in PR #22043.

Release version

3.5.8 (x64)

Operating system

Windows 11 with WSL2 Ubuntu

Related issues

Activity

  1. added
    bug
    priority-2
    and removed on May 20, 2026
  2. zcsizmadia commented on Aug 29, 2026

    @zcsizmadia

    A different angle on the same 9P cost, in case it's useful to anyone finding this issue by search.

    I ran into this from the general Windows-tooling side rather than Desktop specifically, and ended up writing a WinFsp filesystem that exposes a WSL2 tree as a drive letter, with the whole tree's metadata mirrored in RAM on the Windows side and kept current by an agent running inside the distro. stat / readdir / negative lookups are then answered locally and never cross the boundary, which is where most of the per-file cost lives.

    Measured on a 3,000-file tree (same machine, same tree):

    walk (enumerate) read (all bytes)
    native, inside WSL 4 ms 39 ms
    \\wsl.localhost (9P) 104 ms 2856 ms
    drive letter 39 ms cold 574 / warm 366 ms

    To be clear about what it does not fix: the win is per-operation, not per-byte. Metadata-heavy work (status, indexers, build systems, anything touching thousands of files) gets most of the benefit; a single large sequential copy is roughly a wash.

    This isn't a substitute for what's proposed here — for Desktop specifically, routing read-only commands through wsl.exe -e git avoids the boundary entirely and doesn't ask users to install a filesystem driver, which seems like the right trade for a GUI app. Mentioning it only because people do land on this issue looking for a general fix for Windows-side tooling.

    https://github.com/zcsizmadia/wsldrive (MIT, WSL2 only)

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

    bugpriority-2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions