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

Better performance when exploring big files #152492

Closed
Masterxilo opened this issue Jun 17, 2022 · 6 comments
Closed

Better performance when exploring big files #152492

Masterxilo opened this issue Jun 17, 2022 · 6 comments
Labels
editor-core Editor basic functionality feature-request Request for new features or functionality file-io File I/O

Comments

@Masterxilo
Copy link

Masterxilo commented Jun 17, 2022

No matter the size of the file, if it is clearly a binary file, the warning "The file is not displayed in the editor because it is binary" should be shown almost instantly. Currently, the time for this message to show up seems to depend on the size of the file and the editor hangs while this is being determined, making accidental clicks costly (timewise).

I sometimes work with multi-100 MB text fies and want to see what they look like by clicking on them instead of having to run head. I would expect clicking on a large text file to have no worse performance than opening a file with just a few dozen lines. Unfortunately, vscode hangs for quite a while before it determines it cannot load the file into memory and then applies the strategy of just displaying a few lines without formatting.
Instead, whenever opening a file, the first few lines should be shown almost instantly in every case.

Because of the current slowness of clicking on a large file, exploring just the first few lines of a bunch of huge text files is very costly (timewise).

Interestingly, vscode doesn't hang up completely when you click on a large text file, but when you click on a small one, it will not charge until the big one is ready. It seems there is only one queue for loading the files, so there's definitely some parallelization potential.

@Masterxilo Masterxilo changed the title Better support for big files Better performance when exploring big files Jun 17, 2022
@sandy081 sandy081 assigned bpasero and unassigned sandy081 Jun 22, 2022
@bpasero
Copy link
Member

bpasero commented Jun 22, 2022

No matter the size of the file, if it is clearly a binary file, the warning "The file is not displayed in the editor because it is binary" should be shown almost instantly. Currently, the time for this message to show up seems to depend on the size of the file and the editor hangs while this is being determined, making accidental clicks costly (timewise).

No, we try to detect if a file is binary reading the first 8kb or so.

@bpasero bpasero added feature-request Request for new features or functionality editor-core Editor basic functionality file-io File I/O labels Jun 22, 2022
@bpasero bpasero removed their assignment Jun 22, 2022
@bpasero
Copy link
Member

bpasero commented Jun 22, 2022

I think this needs a combination of editor support to stream a model while you scroll and support this in the file layer to only read what you see. We already support reading at position and offset, but it might not be exposed to extension authors.

//cc @hediet @alexdima

@VSCodeTriageBot VSCodeTriageBot added this to the Backlog Candidates milestone Jun 22, 2022
@VSCodeTriageBot
Copy link
Collaborator

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@AlbertoPdRF
Copy link

Hey @bpasero!

I believe you are right when you say that reading at position and offset is not yet exposed to extension authors, see #84515 (comment). The proposed API, linked in the comment, is now on its own file here. Is there any plan to make this proposed API available to extension authors?

Thanks!

@VSCodeTriageBot
Copy link
Collaborator

This feature request has not yet received the 20 community upvotes it takes to make to our backlog. 10 days to go. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@VSCodeTriageBot
Copy link
Collaborator

🙁 In the last 60 days, this feature request has received less than 20 community upvotes and we closed it. Still a big Thank You to you for taking the time to create this issue! To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@VSCodeTriageBot VSCodeTriageBot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 22, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Oct 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
editor-core Editor basic functionality feature-request Request for new features or functionality file-io File I/O
Projects
None yet
Development

No branches or pull requests

5 participants