Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opening large binary files reads full contents #138805

Closed
kaala opened this issue Dec 10, 2021 · 5 comments
Closed

Opening large binary files reads full contents #138805

kaala opened this issue Dec 10, 2021 · 5 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug file-io File I/O important Issue identified as high-priority verified Verification succeeded
Milestone

Comments

@kaala
Copy link

kaala commented Dec 10, 2021

Does this issue occur when all extensions are disabled?: Yes

Version: 1.63.0 (Universal)
OS: Darwin x64 20.6.0

Steps to Reproduce:

  1. open a folder contains some very large zip files
  2. select the zip files
  3. edit pane become unresponsive
  4. after a long time, edit pane display message: The file is not displayed in the editor because it is either binary or uses an unsupported text encoding

I don't want to open zip file in vscode, but there are some time I select the file by mistake. and then vscode freeze for a long time.
This happens both in vscode and vscode remote ssh.
I need a file extension blacklist, or make the binary detect fast.

@j824h
Copy link
Contributor

j824h commented Dec 10, 2021

Related to #132771.
When I've made the same mistakes, I don't usually felt that encoding detection is so slow.
Does it work differently in macOS from in Windows or GNU/Linux?

@bpasero
Copy link
Member

bpasero commented Dec 10, 2021

Can you try to reproduce with our nightly insider builds? You can give our preview releases a try from: https://code.visualstudio.com/insiders/

@bpasero bpasero added info-needed Issue requires more information from poster bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority and removed info-needed Issue requires more information from poster labels Dec 10, 2021
@bpasero bpasero added this to the January 2022 milestone Dec 10, 2021
@bpasero bpasero added file-encoding File encoding type issues file-io File I/O and removed file-encoding File encoding type issues labels Dec 10, 2021
@bpasero
Copy link
Member

bpasero commented Dec 10, 2021

Nevermind, great catch. We indeed seem to read the entire file and try to decode it even though we could bail out earlier given we only accept text.

This does not seem like a regression though, I can reproduce slowness also in previous stable.

@kaala
Copy link
Author

kaala commented Dec 10, 2021

The problem also exist in insider build
You are correct about decode
图片

@bpasero bpasero changed the title open binary file takes long time Opening large binary files reads full contents Dec 10, 2021
@bpasero
Copy link
Member

bpasero commented Dec 10, 2021

A fix for this will be available in our insiders build on Monday, would be good to verify then. I also tried to tackle #132771 so that the reading of large files really stops on the remote end as well.

You can give our preview releases a try from: https://code.visualstudio.com/insiders/

@bpasero bpasero closed this as completed Dec 10, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Jan 24, 2022
@hediet hediet added the verified Verification succeeded label Jan 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug file-io File I/O important Issue identified as high-priority verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

4 participants