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

Extremely poor performance when working with large array literals #7334

Closed
jtanx opened this issue Apr 10, 2021 · 6 comments
Closed

Extremely poor performance when working with large array literals #7334

jtanx opened this issue Apr 10, 2021 · 6 comments
Labels
bug fixed Check the Milestone for the release in which the fix is or will be available. Language Service performance quick fix verified Bug has been reproduced
Milestone

Comments

@jtanx
Copy link

jtanx commented Apr 10, 2021

Bug type: Language Service

Describe the bug

  • OS and Version: Windows 10 20H2
  • VS Code Version: 1.54.3
  • C/C++ Extension Version: 1.2.2
  • Other extensions you installed (and if the issue persists after disabling them):
  • If using SSH remote, specify OS of remote machine: N/A

When working with large array literals, VSCode can lock up/freeze for extended periods of time.

Steps to reproduce

Lockup 1

  1. Open this source file uninames.zip
  2. Hover over lexicon or phrasebook
  3. VSCode slows down, often freezing completely. Will sometimes report that the window is not responding:
    image

Lockup 2

  1. Open this source file: uninames2.zip
  2. Collapse all the arrays:
    image
  3. Close the file (I'm doing this as part of a workspace)
  4. Reopen the file, it will lock up here, choking on the collapsed arrays somehow

Expected behavior

Not locking up VSCode at a minimum, much better responsiveness would be ideal.

Code sample and logs

  • Code sample: See above

  • Configurations in c_cpp_properties.json: N/A

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

-------- Diagnostics - 10/04/2021, 7:40:18 pm
Version: 1.2.2
Current Configuration:
{
    "name": "Win32",
    "includePath": [
        "C:/msys64/mingw32/include",
        "${workspaceFolder}/**"
    ],
    "defines": [
        "_DEBUG",
        "UNICODE",
        "_UNICODE"
    ],
    "windowsSdkVersion": "10.0.18362.0",
    "compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/cl.exe",
    "cStandard": "c17",
    "intelliSenseMode": "windows-msvc-x64",
    "compilerArgs": [],
    "cppStandard": "c++17",
    "intelliSenseModeIsExplicit": true,
    "cStandardIsExplicit": true,
    "cppStandardIsExplicit": true,
    "compilerPathIsExplicit": true,
    "browse": {
        "path": [
            "C:/msys64/mingw32/include",
            "${workspaceFolder}/**"
        ],
        "limitSymbolsToIncludedHeaders": true
    }
}
Translation Unit Mappings:
[ C:\msys64\home\_\ffbuild\work\mingw32\fontforge\Unicode\uninames.c ]:
    C:\MSYS64\HOME\_\FFBUILD\WORK\MINGW32\FONTFORGE\UNICODE\UNINAMES.C
[ C:\Users\_\Documents\2019\FontForge\unicode\UnicodeData.txt ]:
    C:\USERS\_\DOCUMENTS\2019\FONTFORGE\UNICODE\UNICODEDATA.TXT
Translation Unit Configurations:
[ C:\msys64\home\_\ffbuild\work\mingw32\fontforge\Unicode\uninames.c ]:
    Process ID: 13176
    Memory Usage: 79 MB
    Compiler Path: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/cl.exe
    Includes:
        C:\MSYS64\MINGW32\INCLUDE
        C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\VC\TOOLS\MSVC\14.26.28801\INCLUDE
        C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\VC\TOOLS\MSVC\14.26.28801\ATLMFC\INCLUDE
        C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\UM
        C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\UCRT
        C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\SHARED
        C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\WINRT
        C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\CPPWINRT
    Defines:
        _DEBUG
        UNICODE
        _UNICODE
    Standard Version: ms_c17
    IntelliSense Mode: windows-msvc-x64
[ C:\Users\_\Documents\2019\FontForge\unicode\UnicodeData.txt ]:
    Process ID: 12532
    Memory Usage: 28 MB
    Compiler Path: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/cl.exe
    Includes:
        C:\MSYS64\MINGW32\INCLUDE
        C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\VC\TOOLS\MSVC\14.26.28801\INCLUDE
        C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\VC\TOOLS\MSVC\14.26.28801\ATLMFC\INCLUDE
        C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\UM
        C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\UCRT
        C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\SHARED
        C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\WINRT
        C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\CPPWINRT
    Defines:
        _DEBUG
        UNICODE
        _UNICODE
    Standard Version: ms_c17
    IntelliSense Mode: windows-msvc-x64
Total Memory Usage: 107 MB

------- Workspace parsing diagnostics -------
Number of folders and files enumerated: 27118
Number of files discovered (not excluded): 22699
Checking for syntax errors: file:///c%3A/msys64/home/_/ffbuild/work/mingw32/fontforge/Unicode/uninames.c
Queueing IntelliSense update for files in translation unit of: C:\MSYS64\HOME\_\FFBUILD\WORK\MINGW32\FONTFORGE\UNICODE\UNINAMES.C
idle loop: reparsing the active document
Checking for syntax errors: file:///c%3A/msys64/home/_/ffbuild/work/mingw32/fontforge/Unicode/uninames.c
Queueing IntelliSense update for files in translation unit of: C:\MSYS64\HOME\_\FFBUILD\WORK\MINGW32\FONTFORGE\UNICODE\UNINAMES.C
Error squiggle count: 0
Update IntelliSense time (sec): 6.161
idle loop: reparsing the active document
Checking for syntax errors: file:///c%3A/Users/_/Documents/2019/FontForge/unicode/UnicodeData.txt
Queueing IntelliSense update for files in translation unit of: C:\USERS\_\DOCUMENTS\2019\FONTFORGE\UNICODE\UNICODEDATA.TXT
Error squiggle count: 31009
Update IntelliSense time (sec): 3.661
Request canceled: 78
idle loop: reparsing the active document
Checking for syntax errors: file:///c%3A/Users/_/Documents/2019/FontForge/unicode/UnicodeData.txt
Queueing IntelliSense update for files in translation unit of: C:\USERS\_\DOCUMENTS\2019\FONTFORGE\UNICODE\UNICODEDATA.TXT
Error squiggle count: 31009
Update IntelliSense time (sec): 3.209

Screenshots

Additional context

@sean-mcmanus sean-mcmanus self-assigned this Apr 12, 2021
@sean-mcmanus sean-mcmanus added this to the 1.4.0 milestone Apr 12, 2021
@sean-mcmanus sean-mcmanus added the verified Bug has been reproduced label Apr 12, 2021
@sean-mcmanus sean-mcmanus added fixed Check the Milestone for the release in which the fix is or will be available. quick fix labels Apr 12, 2021
@sean-mcmanus
Copy link
Contributor

We were returning too many characters on hover. The fix should be in 1.4.0-insiders (might not be available for a few weeks though).

@jtanx
Copy link
Author

jtanx commented Apr 12, 2021

Nice, thanks!

Was that also the cause of the freeze when reopening the file with collapsed sections?

@sean-mcmanus
Copy link
Contributor

Oops, yeah, the collapsing issue is different. I'm still investigating that...

@sean-mcmanus
Copy link
Contributor

sean-mcmanus commented Apr 12, 2021

The freeze when opening VS Code with the regions collapsed appears to be a VS Code issue that repros when all extensions are disabled. You should file an issue at https://github.com/microsoft/vscode/issues . They may ask for additional performance data from https://github.com/microsoft/vscode/wiki/Performance-Issues , although the VS Code team should probably be able to get that info themselves by following the repro steps.

Don't mention the C/C++ extension and say you have all extensions disabled or they may blame our extension.

@jtanx
Copy link
Author

jtanx commented Apr 13, 2021

Right, I see, thanks for your help!

@sean-mcmanus
Copy link
Contributor

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug fixed Check the Milestone for the release in which the fix is or will be available. Language Service performance quick fix verified Bug has been reproduced
Projects
None yet
Development

No branches or pull requests

2 participants