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

Performance issue on IntelliSense after the verion 1.18.5 #12348

Open
XuPengfei-1020 opened this issue Jun 4, 2024 · 10 comments
Open

Performance issue on IntelliSense after the verion 1.18.5 #12348

XuPengfei-1020 opened this issue Jun 4, 2024 · 10 comments
Assignees
Labels
bug duplicate performance regression A bug that didn't exist in a previous release

Comments

@XuPengfei-1020
Copy link

Environment

  • OS and Version:
    Local mode: mac
    Remote mode: mac-client, linux-server
  • VS Code Version: 1.18.9 dc96b837cf6bb4af9cd736aa3af08cf8279f7685
  • C/C++ Extension Version: after 1.18.5
  • If using SSH remote, specify OS of remote machine: centos 7.9 (or on mac locally)

Bug Summary and Steps to Reproduce

Bug Summary:
IntelliSense is rather slowly, prevent the functions which are dependent on IntelliSense. Whatever file I open, the IntelliSense process is spining for even a minute, and before it finished I can do nothing about the functions which are dependent on the IntelliSense.

Steps to reproduce:

  1. Run vscode on mac locally or a linux server remotely, checkout the project: https://github.com/apache/doris, master branch is ok.
  2. install the c++ extension pack (which contains cpptools of version greatter than 1.18.5)
  3. Open a file under the forder $project-root/be/sre.
  4. Try the functions releated with IntelliSense.

Expected behavior:
IntelliSense is extremlly slow, and prevent you using the functions which are denpendent on the IntelliSense.

Configuration and Logs

/

Other Extensions

No response

Additional context

I try the cpptools extension version by version, and I found that the IntelliSense is smooth at (and before) the version 1.18.5, if I update the extesion to version which is greater than 1.18.5, the issue will appear.

So it may be helpful that checkout the changes between 1.18.5 and 1.19.5.

@sean-mcmanus sean-mcmanus self-assigned this Jun 4, 2024
@sean-mcmanus
Copy link
Collaborator

sean-mcmanus commented Jun 4, 2024

@XuPengfei-1020 Can you set C_Cpp.loggingLevel to "Debug" and look at the C/C++ logging after opening a file logging text that indicates what is blocking the IntelliSense operation? In particulary, what does it show for "Update IntelliSense time (sec):" or mentions of a filename cache.

This may be a duplicate of #12169

@sean-mcmanus sean-mcmanus added bug more info needed The issue report is not actionable in its current state performance regression A bug that didn't exist in a previous release labels Jun 4, 2024
@heartacker
Copy link

image

we hang there @sean-mcmanus

@heartacker
Copy link

IT Take very long time till I reload my vscode

@XuPengfei-1020
Copy link
Author

XuPengfei-1020 commented Jun 5, 2024

@XuPengfei-1020 Can you set C_Cpp.loggingLevel to "Debug" and look at the C/C++ logging after opening a file logging text that indicates what is blocking the IntelliSense operation? In particulary, what does it show for "Update IntelliSense time (sec):" or mentions of a filename cache.

This may be a duplicate of #12169

cpp_extension.log

@XuPengfei-1020
Copy link
Author

I have tried clangd extension, I am sorry to say that there has a long way for cpptools extension to go.
Clangd is far more smooth than cpptolls(even 1.17.5 version) on IntelliSense, just for now (may be caused by the project I opend is a bit large, it contains more than 3k cpp/h files).

Now I have to use clangd extension.
I will switch to cpptools later after this bug has been fixed.
Thank you.

@heartacker
Copy link

LSP: Sending response (id: 158)
LSP: Sending response (id: 154)
LSP: Sending response (id: 157)
Update IntelliSense time (sec): 26.648
LSP: (received) cpptools/getFoldingRanges: file:///root/palo/be/src/olap/cumulative_compaction_time_series_policy.h (id: 159)
LSP: (invoked) cpptools/getFoldingRanges: file:///root/palo/be/src/olap/cumulative_compaction_time_series_policy.h (id: 159)

@Colengms
Copy link
Collaborator

Colengms commented Jun 5, 2024

Hi @XuPengfei-1020 , @heartacker . Can you be more specific about the version number that introduced the issue, by trying out the available 'insiders' versions between 1.18.5 and 1.19.5?

Update IntelliSense time (sec): 26.648

This number indicates when IntelliSense processing has gone idle for all open files. This will have increased in 1.19.2 due to IntelliSense improvements to update files 'progressively'. IntelliSense will be functional, and the currently visible portion of the file(s) on screen will be updated, colorized, etc., much more quickly than previously. This number is not a representation of how quickly IntelliSense is usable or results are available for any particular file. This number is not an indicator of IntelliSense performance. IntelliSense will be fully functional before this is logged.

If you enable "C_Cpp.loggingLevel": "7", you can see individual progressive updates. As soon as you see the first such update, the visible portion of the file should be fully updated and IntelliSense ready to use. The remaining updates, up until Update IntelliSense time indicate work to populate colorization, errors, etc., outside of the currently visible range of the file, asynchronously.

Opening the doris project at the suggested path, with that log level set, and no other configuration (as none was mentioned in the issue), IntelliSense does not appear to be configured for me. It's necessary to configure the C/C++ Extension with the same information used to build the code, for the same reason that it's needed to build the code - IntelliSense is a front-end C++ compiler. It needs to know the defines and include paths necessary to parse/build the code. Without this, the C/C++ Extension may perform an excessive amount of work trying to access files it's unable to find and try to parse code it's not been configured to parse correctly. When using a large project without a configuration, I would not expect most IntelliSense functionality to work properly or quickly.

I don't think we yet have enough information to investigate this issue. Could either of you please provide concise repro steps with a project that is configured for IntelliSense? The doris project does appear to include CMakeLists.txt files, so the C/C++ Extension could potentially be configured using the CMake Tools extension. But this did not appear to get configured for me 'out of the box', given the complex directory structure of that project.

I'm unable to reproduce any obvious performance issue with files in the doris project. To investigate further, I think we'll need more information, such as an example project and an associated correct IntelliSense configuration, specific files to open, and other specific steps on what operations to perform and what is not as expected. If we're not able to repro locally, we may also need detailed logs from your own repro(s). How to collect that information is in our new issue template, and would generally include the results of the C/C++: Log Diagnostics command (with the reproing file open), setting and configuration details, and C/C++ output logs with C_Cpp.loggingLevel set to Debug. The C/C++ Extension may function very different depending on how/if it's been configured and what features are used, so we really do need very specific information to investigate repros.

@heartacker
Copy link

image

we hang there @sean-mcmanus

名称: C/C++
ID: ms-vscode.cpptools
说明: C/C++ IntelliSense, debugging, and code browsing.
版本: 1.20.5 @Colengms
发布者: Microsoft
VS Marketplace 链接: https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools

@sean-mcmanus sean-mcmanus assigned Colengms and unassigned sean-mcmanus Jun 5, 2024
@XuPengfei-1020
Copy link
Author

XuPengfei-1020 commented Jun 6, 2024

"This number is not an indicator of IntelliSense performance. IntelliSense will be fully functional before this is logged."
@Colengms Very appreciate for your patient explanation.

Is the IntelliSence dependent on the cmake-tools extension?
After I config the cmake-tools and run it, I got a warn msg: , see:
”Using 'DEBUG' for CMAKE_BUILD_TYPE instead of 'Debug' to ensure that IntelliSense configurations can be found.“
I don`t know whether the IntelliSense issue is related with this.
Details about it in this issue I posted to cmake-took extension: microsoft/vscode-cmake-tools#3807

Env of project Doris and the step of producing the issue:

  1. Clone the doris project from https://github.com/apache/doris/tree/2.1.0-release, checkout the tag: [2.1.0-release]
  2. Pull the doris dev docker image: apache/doris:build-env-ldb-toolchain-latest, either linux or windows docker-desktop is ok.
  3. Run the docker image, mount the doris project root folder on the ~/doris in container (Or pull the doris project in containers, anyway is ok).
  4. Start vscode(latest version is ok), connect into the container(either by ssh(you need to enable sshd in the container) or use local-container-extension is ok), run the vscode as remote mode.
  5. Install the c++-extension-pack(latest version is ok), and config the cmake-tools (compiler is /var/local/ldb-toolchain/bin/clang, src is $doris/be/).
  6. Try to open some files under the folder $project/be/src/olap/(such as tablet.cpp, table.h)
  7. Try to go to the definition of the included files using cmd/ctrl + left-click on <#include $file>.
  8. Try to go to the definition of the functions/symbols which defined in other cpp/h file and referenced by current file.

@sean-mcmanus
Copy link
Collaborator

I think this is a duplicate of #12292 and a regression caused by adding more stuff to the database for 1.19.x. This might get fixed/improved by not blocking IntelliSense on tag parsing with 1.21.2+.

@sean-mcmanus sean-mcmanus added duplicate and removed more info needed The issue report is not actionable in its current state labels Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug duplicate performance regression A bug that didn't exist in a previous release
Projects
None yet
Development

No branches or pull requests

4 participants