microsoft / microsoft/vscode-cpptools

performance issues editing header files on embedded system with SD card

Offen
#9,339 7 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Language Service performance
Vorherrschende Sprache
TypeScript
Sterne
6.2k
Forks
1.7k
Ø Merge
14 Std. 46 Min.
Gemergte PRs (30 T.)
61

Beschreibung

Describe the bug

  • Latest MacOS "client" connected to small embedded linux Ubuntu 18.04 remote machine "target" via SSH and inside that Ubuntu 18.04 docker container using an SD card for storage
  • VS Code version 1.67.1
  • C/C++ extension version 1.10.2 pre-release (due to https://github.com/microsoft/vscode-cpptools/issues/9247)
  • Only other extensions installed are cmake and cmake tools

I have a cmake-based build configuration and intellisense is correctly finding all dependencies and providing full and correct reporting of issues related to type hints.

Functionality such as auto-completion, problem-reporting, and auto-formatting are incredibly slow when editing header files. For example, occasionally after saving a file I'll see this for a solid 10s or so even on a simple file:

image

Based on this comment I tried setting "C_Cpp.intelliSenseCacheSize": 0 and it has helped the situation.

Steps to reproduce

Set up a C++ project on an embedded system like a Raspberry Pi or Jetson Nano and try editing header files.

Expected behavior

Relatively consistent and hopefully snappy intellisense and auto-formatting performance

Code sample and logs

Configurations in c_cpp_properties.json

{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [],
            "compilerPath": "/usr/bin/gcc",
            "cStandard": "c11",
            "cppStandard": "gnu++14",
            "intelliSenseMode": "linux-gcc-arm64",
            "configurationProvider": "ms-vscode.cmake-tools"
        }
    ],
    "version": 4
}

Logs from running C/C++: Log Diagnostics from the VS Code command palette

-------- Diagnostics - 5/20/2022, 5:49:21 PM
Version: 1.10.2
Current Configuration:
{
    "name": "Linux",
    "includePath": [
        "${workspaceFolder}/**"
    ],
    "defines": [],
    "compilerPath": "/usr/bin/gcc",
    "cStandard": "c11",
    "cppStandard": "gnu++14",
    "intelliSenseMode": "linux-gcc-arm64",
    "configurationProvider": "ms-vscode.cmake-tools",
    "compilerPathIsExplicit": true,
    "cStandardIsExplicit": true,
    "cppStandardIsExplicit": true,
    "intelliSenseModeIsExplicit": true,
    "mergeConfigurations": false,
    "browse": {
        "path": [
            "${workspaceFolder}/**"
        ],
        "limitSymbolsToIncludedHeaders": true
    }
}
Custom browse configuration: 
{
    "browsePath": [
        "##redacted##",
        "##redacted##",
        "##redacted##",
        "##redacted##",
        "##redacted##"
    ],
    "compilerPath": "/usr/bin/aarch64-linux-gnu-g++",
    "compilerArgs": [
        "-g"
    ],
    "compilerArgsLegacy": [
        "-g"
    ]
}
Custom configurations:
[ ##redacted## ]
{
    "defines": [
        "GLFW_DLL"
    ],
    "includePath": [
        "##redacted##",
        "##redacted##",
        "##redacted##",
        "##redacted##",
        "##redacted##"
    ],
    "compilerPath": "/usr/bin/aarch64-linux-gnu-g++",
    "compilerArgs": [
        "-g"
    ]
}
Translation Unit Mappings:
[ ##redacted## ]:
    ##redacted## *
Translation Unit Configurations:
[ ##redacted## ]:
    Process ID: 4899
    Memory Usage: 200 MB
    Compiler Path: /usr/bin/aarch64-linux-gnu-g++
    Includes:
        ##redacted##
        ##redacted##
        ##redacted##
        ##redacted##
        ##redacted##
        ##redacted##
    Defines:
        GLFW_DLL
    Standard Version: c++14
    IntelliSense Mode: linux-gcc-arm64
    Other Flags:
        --g++
        --gnu_version=70500
Total Memory Usage: 200 MB

------- Workspace parsing diagnostics -------
Number of files discovered (not excluded): 29046
Number of files parsed: 2771

Logs from the language server logging - let me know if this would be helpful.

Additional context

Let me know if there are further steps I can easily take to identify offending processes. I briefly looked at the Troubleshooting page, but the perf profiling tool does not seem to be available on the embedded ARM platform I'm currently developing against (NVIDIA tegra) and compiling/installing it didn't go smoothly.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Reproduziere das gemeldete Setup: VS Code mit der C/C++-Erweiterung, ein CMake-Projekt in einem Ubuntu-18.04-Docker-Container auf einem eingebetteten System mit SD-Kartenspeicher. Beginne mit der Seite zur Behebung von Performance-Problemen in C/C++, C/C++: Log Diagnostics und den Language-Server-Logs; vergleiche das Verhalten mit intelliSenseCacheSize auf 0 gesetzt. Als abgeschlossen gilt, wenn die Ursache der Verzögerung identifiziert und eine konsistente Editier-Performance erreicht wurde.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
cmake, cpp, docker, ubuntu, vscode
Bereich
devtools, operating-systems, performance
Issue-Typ
Bug
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
30/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.