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

Switch Source Header is very slow #231

Closed
djg opened this issue Sep 16, 2016 · 11 comments
Closed

Switch Source Header is very slow #231

djg opened this issue Sep 16, 2016 · 11 comments

Comments

@djg
Copy link

djg commented Sep 16, 2016

I'm using vscode + cpptools with a very large codebase. When switching from .cpp to .h and back, vscode is very slow to respond the first time when toggling between files, especially when switching from .h back to .cpp. It takes seconds to complete, which makes it feel like the feature isn't working.

Can we have fast switching, or a more prominent visual indicator that signals that the process of switching is still "working on it."?

@jyavenard
Copy link

+1 vote here.

It takes sometimes over 30s to switch between a .cpp and its corresponding header. Even though both are currently opened.

Typically the 2nd alt-O will be faster, but still far from instantaneous.

@jhasse
Copy link

jhasse commented Sep 16, 2016

I noticed that this happens only on Windows. On Linux with the same project (~400 source files) it switches instantly.

@jyavenard
Copy link

Seeing this on both a mac (10.11.6) and Linux (ubuntu 16.04).
This is working with a rather big project (151870 files)

@sean-mcmanus
Copy link
Contributor

Thanks for bringing this perf problem to our attention. I am able to repro it and I see the code that is taking a long time building a "file system tree", which doesn't scale well with lots of files. We'll investigate making this scenario faster in a future release.

@djg
Copy link
Author

djg commented Sep 16, 2016

In all the setups I've used, the alternate file in either in the same dir or separated include/file.h,src/file.cpp. Maybe it would be faster to first check for those, before creating a file system tree?

@sean-mcmanus sean-mcmanus self-assigned this Sep 16, 2016
@bobbrow
Copy link
Member

bobbrow commented Mar 2, 2017

This should be fixed in 0.10.2. Please reopen if you continue to see the issue.

@bobbrow bobbrow closed this as completed Mar 2, 2017
@jyavenard
Copy link

Version 1.11 has seriously regressed this feature. in fact switching between header/code almost never works now :(

@sean-mcmanus
Copy link
Contributor

@jyavenard What was your previous version of cpptools that was working? Is it red in the bottom right and does it say "Searching..." for #include headers that can't be found? Are the source/target files in the same folder? I assume slowness or switching to the wrong file isn't the problem and that the symptom is that no switching ever occurs? What OS are you using? We're not able to repro a problem so we need more info. It'd be better if you created a new bug, because this bug was about the original implementation which could take a long time to switch. The new implementation will generally fail to switch if the target file isn't added to the browse database for some reason, so deleting your .browse.vc.db or changing the databaseFilename property in the c_cpp_properties.json may fix the issue and cause the target file to be correctly re-added.

@jyavenard
Copy link

@sean-mcmanus I don't know which version it was before. After reverting to 1.10 (due to issue #24052), it still no longer works.

The bottom of my window are all in blue.
Source/Target are in the same folder.

Using 10.12.4 ... Yes, I think it's no longer slow, it just doesn't work at all anymore :)

It was working a few days ago, nothing has been changed in my configuration in month..

will create a new bug

@jyavenard
Copy link

(FWIW, I have no .browse.vc.db on my home directory)

@sean-mcmanus
Copy link
Contributor

@jyavenard On Mac, the default .browse.vc.db location should be under /Users/<user>/Library/Application Support/Code/User/workspaceStorage , but if the source/target are in the same folder, the switching should work without a browse database with 0.10.5...unless the entire language server process is failing. I'll follow up in the new bug...

@sean-mcmanus sean-mcmanus removed their assignment Apr 22, 2019
@github-actions github-actions bot locked and limited conversation to collaborators Oct 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants