Skip to content

Remove declaration-only-compilation from CompilationTracker#56139

Merged
CyrusNajmabadi merged 24 commits intodotnet:mainfrom
CyrusNajmabadi:removeDeclCompilatino
Sep 8, 2021
Merged

Remove declaration-only-compilation from CompilationTracker#56139
CyrusNajmabadi merged 24 commits intodotnet:mainfrom
CyrusNajmabadi:removeDeclCompilatino

Conversation

@CyrusNajmabadi
Copy link
Copy Markdown
Contributor

We used this compilation to speed up some string searches for certain features (and some public APIs we have). Turns out we don't need this given the indices we already have for features like FAR and NavTo. Given this, we can remove this compilation and simplify the compilation tracker a bunch.

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner September 2, 2021 21:35
@ghost ghost added the Area-IDE label Sep 2, 2021
if (!this.SupportsCompilation)
return false;

var tasks = this.Documents.Select(async d =>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Source generated documents?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

nope! i want to make sure we have a way to do source-gen'ed docs in a way that features can say if they need low-latency or not. We don't want to slow down things like 'add using' behind arbitrary 3rd party code. let's chat about a plan on that for monday.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Agreed, we probably want some flag here or something, but needs to be done carefully.

@CyrusNajmabadi
Copy link
Copy Markdown
Contributor Author

@jasonmalinowski this is ready for review.

Copy link
Copy Markdown
Member

@jasonmalinowski jasonmalinowski left a comment

Choose a reason for hiding this comment

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

:shipit:, and I love the state renames to things that explain a lot more their current needs.

/// produce in progress snapshots that can be accessed from other threads.
/// </summary>
private Task<CompilationInfo> BuildCompilationInfoAsync(
private async Task<CompilationInfo> BuildCompilationInfoAsync(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Did we need the async here?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

(we had gotten away with not needing the extra state machine before, not sure what forced it now)

Comment on lines -588 to +586
WriteState(new FullDeclarationState(compilation, TextDocumentStates<SourceGeneratedDocumentState>.Empty, generatorDriver: null, generatedDocumentsAreFinal: false), solutionServices);
WriteState(new AllSyntaxTreesParsedState(compilation, generatedDocuments, generatorDriver, generatedDocumentsAreFinal), solutionServices);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hmm, good catch to make sure we don't lose these -- I can't tell if we had a bug here before (where in some obscure cases we might end up losing prior generated documents), or whether we couldn't have gotten here before once we had generated everything.

if (!this.SupportsCompilation)
return false;

var tasks = this.Documents.Select(async d =>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Agreed, we probably want some flag here or something, but needs to be done carefully.

// full compilation if we don't have that.
// Do a quick syntactic check first using our cheaply built indices. That will help us avoid creating
// a compilation here if it's not necessary. In the case of an exact name search we can call a special
// overload that quickly uses the direct bloom-filter identifier maps in the index. If it's nto an
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
// overload that quickly uses the direct bloom-filter identifier maps in the index. If it's nto an
// overload that quickly uses the direct bloom-filter identifier maps in the index. If it's not an

@CyrusNajmabadi CyrusNajmabadi merged commit e0909cf into dotnet:main Sep 8, 2021
@ghost ghost added this to the Next milestone Sep 8, 2021
@CyrusNajmabadi CyrusNajmabadi deleted the removeDeclCompilatino branch September 8, 2021 23:38
@Cosifne Cosifne modified the milestones: Next, 17.0.P5 Sep 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants