Improve project load/unload performance around linked file mapping#346
Merged
dpoeschl merged 1 commit intodotnet:masterfrom Feb 16, 2015
Merged
Conversation
When a project with N files is loaded or unloaded, the project will be forked N times, each time adding or removing one of the N files. For each of those forks, we need to update the Solution's map of linked files. The process of updating the linked files map was previously O(N^2), resulting in an overall O(N^3) project load/unload process. This change makes makes the linked file map calculation O(1) and therefore the project load/unload process O(N). Updating the linked files map was previously O(N^2) because it tried to account for arbitrary project edits that might have added any number of files and removed any number of files. However, all project-related forking actually happens at either the level of the entire project (which was already special-cased) or at the level of an individual file. We now handle the case of individual file adds/removes efficiently. This fixes internal issue 1112399
Member
|
👍 |
dpoeschl
added a commit
that referenced
this pull request
Feb 16, 2015
Improve project load/unload performance around linked file mapping
dibarbet
pushed a commit
to dibarbet/roslyn
that referenced
this pull request
Nov 21, 2025
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a project with N files is loaded or unloaded, the project will be
forked N times, each time adding or removing one of the N files. For
each of those forks, we need to update the Solution's map of linked
files. The process of updating the linked files map was previously
O(N^2), resulting in an overall O(N^3) project load/unload process. This
change makes makes the linked file map calculation O(1) and therefore
the project load/unload process O(N).
Updating the linked files map was previously O(N^2) because it tried to
account for arbitrary project edits that might have added any number of
files and removed any number of files. However, all project-related
forking actually happens at either the level of the entire project
(which was already special-cased) or at the level of an individual file.
We now handle the case of individual file adds/removes efficiently.
This fixes internal issue 1112399