ProgramParser.ParseFiles already was an asynchronous operation, but the parse caching mechanism did not take this into account, so it could start pruning the caching before a parsing run was completed, causing cache entries to be incorrectly pruned, leading to less caching of parsing. The resolution cache depends on GUIDs from the parsing cache to determine cache keys for modules, so this also broke resolution caching.
PruneIfNotUsedSinceLastPruneCache was not thread-safe, so doing two use+prune operations concurrently could serialize to a use+use+prune+prune operation, which would incorrectly prune things.
Fix a bug in ProjectManager that cause could the processing of a compilation to crash after opening a new document in an already open project.
A profiling session showed lots of time going into computing Count on ConcatReadOnlyList, so that property is now computed just once for such a list. However, this problem really requires more IDE performance tests.
Update included files message
How has this been tested?
Added a test ConcurrentCompilationDoesNotBreakCaching to check that caching work swell when concurrent operations occur
Added a test DocumentAddedToExistingProjectDoesNotCrash that checks whether adding documents to an existing project does not cause a compilation to crash.
By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.
Description
ProgramParser.ParseFiles
already was an asynchronous operation, but the parse caching mechanism did not take this into account, so it could start pruning the caching before a parsing run was completed, causing cache entries to be incorrectly pruned, leading to less caching of parsing. The resolution cache depends on GUIDs from the parsing cache to determine cache keys for modules, so this also broke resolution caching.PruneIfNotUsedSinceLastPruneCache
was not thread-safe, so doing two use+prune operations concurrently could serialize to a use+use+prune+prune operation, which would incorrectly prune things.ProjectManager
that cause could the processing of a compilation to crash after opening a new document in an already open project.Count
onConcatReadOnlyList
, so that property is now computed just once for such a list. However, this problem really requires more IDE performance tests.How has this been tested?
ConcurrentCompilationDoesNotBreakCaching
to check that caching work swell when concurrent operations occurDocumentAddedToExistingProjectDoesNotCrash
that checks whether adding documents to an existing project does not cause a compilation to crash.By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.