Skip to content

Conversation

@vasily-kirichenko
Copy link
Contributor

@vasily-kirichenko vasily-kirichenko commented Jul 14, 2017

It's based on #3328 and should be merged after it.

@vasily-kirichenko vasily-kirichenko changed the title [WIP] Project cache size option Project cache size option Jul 14, 2017
@vasily-kirichenko
Copy link
Contributor Author

image

<value>Code Fixes</value>
</data>
<data name="6011" xml:space="preserve">
<value>Language Service Performance</value>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just use "Performance" I think. It is under "Text Editor"


store.RegisterDefault
{ EnableInMemoryCrossProjectReferences = true
ProjectCheckCacheSize = 3 }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default should be 200 since that's what we shipped in VS2017 (i.e. let's not change the default in this PR)

@dsyme
Copy link
Contributor

dsyme commented Jul 14, 2017

Just two requested edits - otherwise approved!

Copy link
Contributor

@dsyme dsyme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just two requested edits - otherwise approved!

@vasily-kirichenko
Copy link
Contributor Author

OK, will push adjustments soon + the edit box validation by @JohanLarsson

@vasily-kirichenko
Copy link
Contributor Author

It's ready.

@dsyme
Copy link
Contributor

dsyme commented Jul 14, 2017

This is ready - @KevinRansom ok to merge

@KevinRansom KevinRansom merged commit 2b6da85 into dotnet:master Jul 14, 2017
@abelbraaksma
Copy link
Contributor

@vasily-kirichenko
May I kindly request we tell users what "cache size" is? Bytes, megabytes, number of projects, number of source files, number of project links, or link depth?

I see it is set to 200, but I have no idea whether I should increase or decrease it for better performance (also, if it is memory, is it an in-process or out of process memory? In case of the latter, I wouldn't care that much of a high value on a 48GB machine, for in-process I have to be careful, as last time I checked VS2017 was limited to its 32 bit address space).

image

Oh, and while we're at it: if we disable this option entirely, what gets disabled? Any cross-project traversal (like going to definition), or only a subset of such features (i.e. XML documentation)?

PS: clicking the question-mark top-right just goes to the homepage

@vasily-kirichenko
Copy link
Contributor Author

vasily-kirichenko commented Aug 22, 2017

First of all, those two settings are not related. "Enable in-memory cross project references" enables cross-project Go to Declaration, Find Usages, Rename, etc. on dirty sources, i.e. those features work OK on changed projects without needing to build them.

The second setting is the project check results cache size, the value is number of projects. You cannot set it to zero because FCS cannot work without a cache for currently edited project. The cache is internal, inside VS x86 process so on large solutions it quickly causes VS to reach > 2GB of private set after which you have no options, but restart it. Setting it to, say, 3 or 5 is fine for memory consumption, but it makes cross project navigation and search and rename practically impossible because it has to recheck all dependent project every time, which can easily take several minutes.

So, turn the checkbox off, set the cache size to 5 and don't use any cross project features.

@cartermp
Copy link
Contributor

@abelbraaksma Just to add to @vasily-kirichenko's excellent comment here, these are present for fine-tuning performance of Visual Studio on your machine. In general, the toggle for in-memory cross-project references will be of value to you if you have a large amount of projects and a deep dependency chain between them. Difference solutions will vary, so there isn't really a clear answer for when you should turn it off or on.

@abelbraaksma
Copy link
Contributor

@vasily-kirichenko & @cartermp: thanks for the excellent explanations!

However, with my comment I actually meant to ask you to add at least some form of explanation to the Options form in Visual Studio itself. I may not be the only one who's puzzled and confused by these settings, however valuable they proof to be.

Setting it to, say, 3 or 5 is fine for memory consumption, but it makes cross project navigation and search and rename practically impossible because it has to recheck all dependent project every time, which can easily take several minutes.

This makes sense, but then I find it mildly odd that the default setting seems to be set to 200?

@vasily-kirichenko
Copy link
Contributor Author

@dsyme wanted it to be 200 to be "backward compatible" (i.e. not user surprising), because this value was hardcoded.

nosami pushed a commit to xamarin/visualfsharp that referenced this pull request Jan 26, 2022
* add option to disable in-memory cross-project references

* fix build

* add "Language Service Performance" option page

* (wip) add "Project Check Cache Size" option

* pass Settings.LanguageServicePerformance.ProjectCheckCacheSize to FSharpChecker.Create

* address the code review

* rename property page, validate project check cache size
nosami pushed a commit to xamarin/visualfsharp that referenced this pull request Jan 26, 2022
* add option to disable in-memory cross-project references

* fix build

* add "Language Service Performance" option page

* (wip) add "Project Check Cache Size" option

* pass Settings.LanguageServicePerformance.ProjectCheckCacheSize to FSharpChecker.Create

* address the code review

* rename property page, validate project check cache size
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants