microsoft / microsoft/vscode-cpptools
Slow Autocomplete for translation units including bulky header files
まだ誰も着手していません。
- 主要言語
- TypeScript
- スター
- 6.2k
- フォーク
- 1.7k
- 平均マージ
- 14時間 46分
- マージ済み PR(30日)
- 61
説明
Type: LanguageService
Describe the bug
- OS and Version: macOS Mojave (10.14.5), MBP Mid 2015
- VS Code Version: 1.36.0
- C/C++ Extension Version: 0.24.0
- Other extensions you installed (and if the issue persists after disabling them): CMake Tools, Git lens
- Autocompletion for source files including bulky header files like the ones given below. Auto complete sometimes takes 5 seconds to return result. Most of the time it steadily takes 2-3 seconds to return results.
Tried disabling/enabling IntelliSense cache yet 4-5 seconds lag was visible.
To Reproduce
Source Sample:
#include <algorithm>
#include <atomic>
#include <chrono>
#include <cstdio>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <random>
#include <thread>
#include <vector>
#include <boost/intrusive/list.hpp>
#include <boost/lockfree/queue.hpp>
#include <boost/program_options.hpp>
Preprocessed file has 1.3 lakh lines (4.4 MB).
c_cpp_properties.json:
{
"configurations": [
{
"name": "Mac",
"includePath": [
"${workspaceFolder}/**",
"${vcpkgRoot}/x64-osx/include"
],
"defines": [],
"macFrameworkPath": [
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks"
],
"compilerPath": "/usr/bin/clang",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "clang-x64",
"configurationProvider": "vector-of-bool.cmake-tools",
"compileCommands": "${workspaceFolder}/build/compile_commands.json"
}
],
"version": 4
}
Expected behavior
Autocompletion returning results within a second always (too much to ask for?).
Screenshots
Instead autocomplete taking 5 seconds to complete

Profiler Output
Just in case, if you may require, I've attached Instruments profile output of server for autocomplete operation.
Run 1 -> IntelliSense caching disabled.

Run 2 -> IntelliSense caching enabled.

Complete Browsable Instruments Trace:
Msvc.Autocomplete.trace.zip
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
C++ ソースサンプル、c_cpp_properties.json、および添付されたプロファイラー出力 Msvc.Autocomplete.trace.zip から始めてください。記載されている標準ヘッダーと Boost ヘッダーでオートコンプリートを再現し、観測された 2~5 秒の遅延を、1 秒以内という想定される応答時間と比較してください。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- cpp, vscode
- 領域
- developer-experience, performance, tooling
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 25/100