Viewing the source files Resharper C++ is indexing

Hi everyone,

When ReSharper C++ starts up, it takes a good 5-10 minutes to finish it's "Updating Source Files" procedure, I enabled the option to show ReSharper memory usage and it goes as high as 2.3GB during this initial start up. Once the startup phase ends, ReSharper's memory usage drops to <200MB.

I would like to try and figure out which source files ReSharper is trying to index. 

I'm working with a project that has many auto generated files that should not be indexed and I am wondering if ReSharper is trying to index these files. I have tried to add the directory that contains these files to the "Generated Code" directory list, but this just gives me an error saying "Some selected folders are not part of solution and were not added".

Note that I only use ReSharper C++.

Thanks

8 comments
Comment actions Permalink

Hello,

Please add a file mask to "Skipped Code" on the "Third-Party Code"  options page to exclude generated files from indexing (https://www.jetbrains.com/help/resharper/Reference_Options_Code_Editing_Third_Party_Code.html).

During indexing you should be able to click on the progress bar, and R++ will show a window with the name of the file that is being processed at the moment.

Thanks!

0
Comment actions Permalink

Thanks for the tip Igor. I can't seem to get the file masks to work. Say I have a directory structure like:

  • C:\Foo\Dir_A
  • C:\Foo\Dir_B
  • C:\Foo\Dir_C

If I wanted to ignore all files under "C:\Foo", would it be sufficient to add the following file mask:

  • C:\Foo\**

Or would I need to add a mask for each of the directories individually?

0
Comment actions Permalink

"C:\Foo\**" should be enough to exclude all files and folders under Foo recursively. You can open the file to check that R++ indeed ignores it - there should be no highlightings and no status indicator there, and ReSharper features won't work.

0
Comment actions Permalink

But you might need to reopen the solution for changes to take effect.

0
Comment actions Permalink

Hi Igor,

Sorry for the delay, I've been battling this on and off over the past few days. Unfortunately I find myself just disabling ReSharper all together due to unresponsiveness...

As a test, I've added the root of my project directory to the file masks list and this seems to work as ReSharper starts up instantly. It seems that if I have a file in my project that includes a file in one of the "third party" directories, ReSharper tries to index it regardless of the mask. Is it possible to dump out the list of files that ReSharper indexes so I can confirm this?

Is there any info you can share about how ReSharper looks for files? Some of the directories it's scanning aren't even set as include directories in the project, so I'm wondering how ReSharper is finding them. (Note that I use a build system external to VS, so it's not necessary for the VS project to have the full build config, VS is only used for code navigation and debugging the app). 

As an aside, I am also noticing that I need to manually collect garbage after the initial parsing.

Thanks

0
Comment actions Permalink

ReSharper works similar to a compiler, so if your header is included into a source file that is indexed, the header will be indexed too regardless of the ignore mask. I don't think there's a way to easily dump cache data, we'll add some logging capability.

Re how indexing works - ReSharper basically takes all files from your project, skips those excluded by the ignore mask, and then "compiles" the rest using the include paths that Visual Studio tells us about.

Note that a 54 second hang definitely shouldn't happen. Does it occur every time you open the solution? If it does and it's possible to reproduce it, please try taking a timeline performance trace as described in https://resharper-support.jetbrains.com/hc/en-us/articles/210652849-Collect-Timeline-performance-snapshot-in-Visual-Studio and we'll take a look.

You shouldn't need to manually run a garbage collection, the memory will eventually get collected by the runtime.

0
Comment actions Permalink

I'll try to capture a trace, although the hangs can be intermittent. Would it be alright if I started a log as soon as I open VS and then stop it once a hang occurs? It could be several minutes of logging. Is it just doing circular buffer logging to an ETL file?

Is there any way I can inspect the contents of the log before sending it?

Thanks

0
Comment actions Permalink

You can take a look at the captured trace with dotTrace (https://www.jetbrains.com/profiler/), but it's essentially an ETL trace. This means it might be quite heavy to capture, and I believe circular logging is not yet supported. Do you notice any particular moments when the hang notification goes up and the indexing process is not running?

Thanks!

0

Please sign in to leave a comment.