With our recent 1.19 release, performance was our biggest focus for the C++ Extension in Visual Studio Code. This included features like progressive population of IntelliSense results and faster symbol searching. With these enhancements, you can begin writing C++ code when opening a file quicker than ever before. Additionally, we also added support for fuzzy results when searching for symbols.
Faster Go To Symbol Search
Searching for symbols using the “Go to Symbol in Workspace” command now uses a new algorithm which returns relevant results in a fraction of the time it took previously.
This new algorithm uses a full-text-search index of symbols that is maintained on the fly, supporting a variety of search methods to find symbols depending on which will be the fastest way to provide results. The search is handled through several different queries, starting with literal matches and progressively moving towards fuzzy matches. This has also added support for fuzzy search results when searching for symbols.
Through our testing, we found an average 5.8x speedup on MacOS, 2.1x on Linux, and 3.1x on Windows. Testing was done using VS Code 1.86.2 on a low-tier machine and searching for a symbol in the PyTorch source code.
Experience this for yourself by upgrading to the new version and using the “Go to Symbol in Workspace” command in the command palette:
Faster Time to Colorization
When opening a source file with the 1.19 version of the C++ Extension installed, semantic highlighting is now much faster. This change is due to the C++ Extension now providing colorization in increments, starting with the visible area, rather than waiting for an entire file to be analyzed before colorization can begin.
Based on our testing, we found an average 1.5x speedup for time to colorization for Windows, 1.8x for Linux, and 1.2x for MacOS. This testing was done using VS Code 1.86.2/1.85.2 on a low-tier machine and colorizing a file in the PyTorch source code.
But what does this difference feel like? Especially when opening large, complex files you can see the change – for example, the amalgamation source file for SQLite which is 8.8MB. Full colorization in this windows based example used to take 11 seconds, now it only takes 3 seconds (3.7x faster than before!):
Note that the colorization speedup might vary based various factors such as the machine used, workspace size, and file size.
Other Enhancements
There have been many other enhancements, performance improvements, and bug fixes included in version 1.19. For example, we added several enhancements when adding #includes to a file. To learn more about these changes, please reference the 1.19 changelog.
What do you think?
Download the C/C++ extension for Visual Studio Code today, give it a try, and let us know what you think.
If you have any questions around this release, feel free to start a discussion in our GitHub repository. Otherwise, if you run into any issues, please report them in the issues section. We can be reached via the comments below, per email at visualcpp@microsoft.com, or through our team on X/Twitter at @VisualC.
0 comments