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 with cpptools #13023

Open
bobbrow opened this issue Dec 5, 2024 · 1 comment
Open

Performance issue with cpptools #13023

bobbrow opened this issue Dec 5, 2024 · 1 comment
Assignees
Labels
bug Language Service more info needed The issue report is not actionable in its current state performance

Comments

@bobbrow
Copy link
Member

bobbrow commented Dec 5, 2024

29th November 2024

VSCode info ::

Version: 1.95.3 (system setup)
Commit: f1a4fb101478ce6ec82fe9627c43efbf9e98c813
Date: 2024-11-13T14:50:04.152Z
Electron: 32.2.1
ElectronBuildId: 10427718
Chromium: 128.0.6613.186
Node.js: 20.18.0
V8: 12.8.374.38-electron.0
OS: Windows_NT x64 10.0.22631

Extension info ::

Name: C/C++
Id: ms-vscode.cpptools
Description: C/C++ IntelliSense, debugging, and code browsing.
Version: 1.22.11
Publisher: Microsoft
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools

Configs ::

{
    "C_Cpp.autocompleteAddParentheses": true,
    "C_Cpp.clang_format_style": "",
    "C_Cpp.codeAnalysis.clangTidy.args": [],
    "C_Cpp.codeAnalysis.clangTidy.codeAction.showDisable": false,
    "C_Cpp.codeAnalysis.clangTidy.enabled": true,
    "C_Cpp.codeFolding": "disabled",
    "C_Cpp.default.compilerArgs": [
        "/C",
        "/DDEBUG",
        "/D_DEBUG",
        "/D__STDC_WANT_SECURE_LIB__",
        "/I./",
        "/I./include/",
        "/Zc:__cplusplus",
        "/Zc:preprocessor",
        "/EHsc",
        "/TP",
        "/Wall",
        "/Od",
        "/std:c++20"
    ],
    "C_Cpp.default.cStandard": "c23",
    "C_Cpp.default.cppStandard": "c++20",
    "C_Cpp.doxygen.generateOnType": false,
    "C_Cpp.errorSquiggles": "enabled",
    "C_Cpp.formatting": "clangFormat",
    "C_Cpp.inlayHints.autoDeclarationTypes.enabled": true,
    "C_Cpp.inlayHints.autoDeclarationTypes.showOnLeft": true,
    "C_Cpp.inlayHints.parameterNames.enabled": true,
    "C_Cpp.inlayHints.referenceOperator.enabled": true,
    "C_Cpp.markdownInComments": "enabled",
    "C_Cpp.suggestSnippets": false,
    "[cuda-cpp]": {
        "editor.wordBasedSuggestions": "allDocuments",
        "editor.suggest.insertMode": "replace",
        "editor.semanticHighlighting.enabled": true
    },
    "extensions.closeExtensionDetailsOnViewChange": true,
    "extensions.ignoreRecommendations": true,
    "files.associations": {
        ".clang-format": "yaml",
        ".clang-tidy": "yaml",
        ".clangd": "yaml",
        "*.cu": "cuda-cpp",
        "*.cuh": "cuda-cpp",
        "*.h": "c",
        "*.c": "c"
    },
    "C_Cpp.default.intelliSenseMode": "windows-msvc-x64",
    "C_Cpp.caseSensitiveFileSupport": "enabled",
    "C_Cpp.preferredPathSeparator": "Backslash",
    "C_Cpp.vcpkg.enabled": false,
    "C_Cpp.configurationWarnings": "disabled",
    "C_Cpp.refactoring.includeHeader": "ifNeeded",
    "C_Cpp.inactiveRegionOpacity": 0.25,
    "C_Cpp.intelliSenseUpdateDelay": 2000,
    "C_Cpp.renameRequiresIdentifier": false,
    "C_Cpp.workspaceParsingPriority": "low",
    "C_Cpp.vcFormat.indent.caseContents": false,
    "C_Cpp.vcFormat.indent.lambdaBracesWhenParameter": false,
    "C_Cpp.vcFormat.indent.namespaceContents": false,
    "C_Cpp.vcFormat.newLine.beforeCatch": false,
    "C_Cpp.vcFormat.newLine.beforeElse": false,
    "C_Cpp.vcFormat.space.afterComma": false,
    "C_Cpp.vcFormat.space.afterKeywordsInControlFlowStatements": false,
    "C_Cpp.vcFormat.space.beforeBlockOpenBrace": false,
    "C_Cpp.vcFormat.space.beforeConstructorColon": false,
    "C_Cpp.vcFormat.space.beforeInheritanceColon": false,
    "C_Cpp.vcFormat.space.groupSquareBrackets": false,
    "C_Cpp.vcFormat.space.removeBeforeSemicolon": false,
    "C_Cpp.vcFormat.space.removeAroundUnaryOperator": false,
    "C_Cpp.vcFormat.space.removeAroundMemberOperators": false,
    "C_Cpp.vcFormat.space.preserveInInitializerList": false,
    "C_Cpp.vcFormat.space.withinInitializerListBraces": false,
    "C_Cpp.simplifyStructuredComments": false,
    "C_Cpp.codeAnalysis.clangTidy.codeAction.showClear": "None",
    "C_Cpp.sshTargetsView": "disabled",
    "C_Cpp.intelliSenseCacheSize": 0,
    "C_Cpp.intelliSenseMemoryLimit": 1024,
    "C_Cpp.maxMemory": 1024,
    "C_Cpp.maxSymbolSearchResults": 500,
}

The same issue on Windows 11. Intellisense is horribly slow and never finishes (for a source file https://github.com/anoban/cpp23/blob/main/rvopt.cpp with just 42 lines of C++ code it takes about 12 minutes immediately after cold start). On the other hand clangd with VSCode insiders does everything in a fraction of a second. I'm not trying to downplay the usefulness of this extension because this is the only extension that provides decent C, C++ debugging experience on Windows but it has become obnoxiously sluggish. Is there a way to fix this from my end? I used to allow it to use memory liberally for caching but it never helped and sometimes consumed up to 2 GiBs of memory so I've now limited those options.

Originally posted by @anoban in #12169

@bobbrow
Copy link
Member Author

bobbrow commented Dec 5, 2024

Hi @anoban,

Can you clarify what is taking 12 minutes for you? I cloned your repo on Windows 11 and didn't see anything like what you describe. For me, the tooltips appear near instantaneously as well as the autocomplete suggestions.

repro.mp4

@bobbrow bobbrow added bug Language Service more info needed The issue report is not actionable in its current state labels Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Language Service more info needed The issue report is not actionable in its current state performance
Projects
Status: No status
Development

No branches or pull requests

1 participant