Skip to content

Improve mount performance by moving validation to mount process and parallelizing I/O#1908

Open
tyrielv wants to merge 4 commits intomicrosoft:masterfrom
tyrielv:tyrielv/faster-mount
Open

Improve mount performance by moving validation to mount process and parallelizing I/O#1908
tyrielv wants to merge 4 commits intomicrosoft:masterfrom
tyrielv:tyrielv/faster-mount

Conversation

@tyrielv
Copy link
Contributor

@tyrielv tyrielv commented Mar 4, 2026

Problem

gvfs mount was slower than necessary because gvfs.exe performed substantial validation before launching gvfs.mount.exe, and then the mount process repeated some of it:

  • Redundant work: Auth, index parsing, and git repo validation ran in both processes
  • Sequential network I/O: Auth/config queries blocked local validations that don't depend on the network
  • Redundant HTTP requests: Anonymous probe + separate config query = two round-trips when one suffices

On a large repo (~2.4M index entries), production mount took ~29s.

Three incremental commits

  1. Move validation from gvfs.exe → gvfs.mount.exe — strip the verb down to pre-launch checks only (~29s → ~22s)
  2. Parallelize local validations with network I/O — run auth+config concurrently with git/hooks/filesystem checks (~22s → ~19s)
  3. Combine auth + config into one HTTP flow — save a round-trip by probing with the config query itself (~19s → ~18s, −38% total)

Testing

All unit tests and CI functional tests pass; manual mount/unmount verified on large repo.

@tyrielv tyrielv changed the title Tyrielv/faster mount Improve mount performance Mar 4, 2026
tyrielv and others added 2 commits March 4, 2026 10:50
Move authentication, server config query, version validation, cache
health checks, git config settings, and enlistment logging from the
mount verb (gvfs.exe) into the mount process (gvfs.mount.exe). This
eliminates duplicate work (auth and index parsing were done in both
processes) and reduces mount time from ~40s to ~22s.

The verb now only does: disk layout upgrade check, ProjFS attach,
enum arg validation, mount exe existence check, launch + wait.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Start auth + config query immediately on entry to Mount(), before repo
metadata loading. This overlaps network latency with all local I/O:
metadata, git version/hooks/filesystem checks, and git config writes.

The network task (auth + config) and local task (validations + git config)
run concurrently via Task.WhenAll. RepoMetadata loading runs on the main
thread between task launch and local task start, overlapping with the
initial anonymous auth probe.

Measured improvement on os.2020 (2.4M index entries):
  Production:  ~29s wall clock
  Sequential:  ~22s (prior commit moved work to mount.exe)
  Parallel:    ~19s (this commit)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@tyrielv tyrielv force-pushed the tyrielv/faster-mount branch from 4e6996d to 80aa37a Compare March 4, 2026 18:53
@tyrielv tyrielv changed the title Improve mount performance Improve mount performance by moving validation to mount process and parallelizing I/O Mar 4, 2026
Add TryInitializeAndQueryGVFSConfig to GitAuthentication that merges
the anonymous probe, credential fetch, and config query into a single
flow, making at most 2 HTTP requests (or 1 for anonymous repos) and
reusing the same TCP/TLS connection.

Refactor TryInitialize to delegate to the combined method, eliminating
the duplicated TryAnonymousQuery logic. Add TryAuthenticateAndQueryGVFSConfig
to GVFSVerb and update CloneVerb, PrefetchVerb, and CacheServerVerb to
use it, replacing the two-step TryAuthenticate + QueryGVFSConfig pattern
with a single call. Remove the now-unused QueryGVFSConfigWithFallbackCacheServer.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@tyrielv tyrielv force-pushed the tyrielv/faster-mount branch from 80aa37a to 2d48281 Compare March 4, 2026 19:55
@tyrielv tyrielv marked this pull request as ready for review March 4, 2026 21:06
@tyrielv tyrielv force-pushed the tyrielv/faster-mount branch from c715fa3 to 129adcd Compare March 5, 2026 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant