sshfs.nvim icon indicating copy to clipboard operation
sshfs.nvim copied to clipboard

Mount: add a local mirror mode so remote files open and save at local speed

Open uhs-robert opened this issue 1 month ago • 0 comments

Files on an sshfs mount are slow to open and save, and I want remote editing that keeps every feature of my local Neovim. Even with no plugins, each open and save on the mount pays 100-300+ ms of round trips, and LSP indexing and pickers still go over FUSE. Re-opening the same file was no faster, so the sshfs cache doesn't help. One open and save with my config made 226 SFTP requests, against 23 with no plugins (117 LSTAT, 33 OPEN, 29 READ, 8 READDIR).

Measured on a real host (ping avg 13 ms, sshfs 3.7.6, Neovim 0.12.6, default mount options), headless, bash scripts in a ~20-file repo, a different file per open:

Setup Open Save
Local copy, no plugins <20 ms <10 ms
Local copy, my config 10-125 ms <20 ms
Mount, no plugins 50-140 ms 40-370 ms
Mount, my config 100-700 ms 60-365 ms

One host, a noisy link and a small sample, so treat these as indicative.

There should be a local mirror mode: pull the remote directory locally, edit at local speed, and sync changes back over the existing SSH connection. The costs I know of are conflicts if the server copy changes, a slow first sync on large trees, and a delay before saves reach the server. This complements #35, which speeds up git on the mount itself; a mirror would make that unnecessary for mirrored trees.

uhs-robert avatar Oct 17 '26 19:10 uhs-robert