SchoofsKelvin / vscode-sshfs

Extension for Visual Studio Code: File system provider using SSH
GNU General Public License v3.0
543 stars 36 forks source link

Very slow when deleting large remote files #245

Open war1644 opened 3 years ago

war1644 commented 3 years ago

I noticed that when deleting large remote files, the download speed increases. Is the download operation first when deleting remote files? The guess behavior is to download first and then delete?

SchoofsKelvin commented 3 years ago

The download speed increases? I assume you mean decreases?

Deleting a file should be a simple request. Unless VS Code is somehow "zero'ing" the file, there shouldn't be any slowdown, especially not afterwards after the deletion finished.

What OS are you using? How large are those remote files? Anything special in the log files?

war1644 commented 3 years ago

System: macos 10.15.7 VS Code Version: 1.54.3

Operation situation:

  1. Use sshfs to extend the xxx.war file in the Remote workspace folders list, the file size is 50M
  2. I noticed that deleting this file was not immediately deleted, but was downloaded first (pay attention to the download speed), which was about 50M after the download was completed, and the remote workspace folders were deleted.

Expected result: To delete files in the Remote workspace folders list, you should delete them immediately, rather than downloading and then deleting

If it's me who didn't do it properly, please let me know thank you

SchoofsKelvin commented 3 years ago

I'll have to check, but what I think is happening:

Should this be the case, there isn't actually much I can do. I could possibly add a caching system, where I check the hash of the downloaded version and the remote version, but this would require me to keep the downloaded version somewhere in memory (or on your local disk), which has its own problems.

If you move the file into a folder, then delete that folder, I assume it's instant?

war1644 commented 3 years ago

Thanks, I have to say that this is a problem caused by my reliance on graphics. I gave up graphical deletion and switched to the watcher method to monitor local changes and overwrite uploads. Thanks again!

finn-matti commented 3 years ago

The workaround with the folder is nice. However, I wonder if something else is going on as regards to this issue:

  • Selecting the file makes VS Code open it in an editor, triggering a download
  • If an editor of it is already open, VS Code will refresh the editor (triggering a redownload)

It seems that setting the VS Code preference like so "workbench.list.openMode": "doubleClick" that big files shouldn't be downloaded. And indeed: If this is is set to doubleClick, files can be selected in the sidebar, but they won't be opened in the editor unless double clicked. They are also not read according to the ssh fs output log.

But when deleting a big file via the context menu, I can see that ssh-fs still tries to read the file regardless of that setting.

Screen Shot 2021-07-02 at 13 47 00

@SchoofsKelvin Maybe it's worth to open this issue again? Or should I start a new one?

SchoofsKelvin commented 3 years ago

I'll reopen this one, since it's probably still the same bug. Although I'm afraid it's not the extension reading it before deletion but VS Code itself doing so.

Apsylem commented 2 years ago

Still the same bug, i just resort to deleting files by command line. Defeats the purpose of an UI, but here we are.