Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve perf on CollectResults #2018

Merged
merged 10 commits into from
Dec 15, 2016
Merged

Conversation

forki
Copy link
Contributor

@forki forki commented Dec 15, 2016

There are situations where we can cut the name resolution

@forki forki changed the title CollectAtMostOneResult Improve perf on CollectResults Dec 15, 2016
@forki forki changed the title Improve perf on CollectResults WIP Improve perf on CollectResults Dec 15, 2016
@forki forki force-pushed the CollectAtMostOneResult branch 3 times, most recently from 3c92ac7 to 7f86562 Compare December 15, 2016 15:47
@forki forki changed the title WIP Improve perf on CollectResults Improve perf on CollectResults Dec 15, 2016
Copy link
Member

@KevinRansom KevinRansom left a comment

Choose a reason for hiding this comment

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

Do we have any measurements about how much time is spent here?

Intuitively it seems like a good spot for optimization, but it would be nice to be able to confirmit.

@@ -2193,7 +2199,7 @@ let rec ResolveExprLongIdentPrim sink (ncenv:NameResolver) fullyQualified m ad n
if List.isEmpty tcrefs then NoResultsOrUsefulErrors else
let tcrefs = tcrefs |> List.map (fun tcref -> (resInfo,tcref))
let tcrefs = CheckForTypeLegitimacyAndMultipleGenericTypeAmbiguities (tcrefs, TypeNameResolutionInfo.ResolveToTypeRefs (TypeNameResolutionStaticArgsInfo.Indefinite), PermitDirectReferenceToGeneratedType.No, unionRanges m id.idRange)
ResolveLongIdentInTyconRefs ncenv nenv LookupKind.Expr 1 m ad rest typeNameResInfo id.idRange tcrefs
ResolveLongIdentInTyconRefs true ncenv nenv LookupKind.Expr 1 m ad rest typeNameResInfo id.idRange tcrefs
Copy link
Member

Choose a reason for hiding this comment

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

Can we use an enum for at most 1, true is a tad tricky to read?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes would have done this anyways. But you are definitely right

(ResolveTypeLongIdentInModuleOrNamespace ncenv typeNameResInfo ad genOk)
|?> List.concat

let modulSearchFailed() =
ResolveLongIndentAsModuleOrNamespaceThen ncenv.amap m fullyQualified nenv AccessibleFromSomeFSharpCode lid
ResolveLongIndentAsModuleOrNamespaceThen false ncenv.amap m fullyQualified nenv AccessibleFromSomeFSharpCode lid
Copy link
Member

Choose a reason for hiding this comment

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

Ditto enum for false.

@KevinRansom
Copy link
Member

@dotnet-bot test this.

failures are not related.

@forki
Copy link
Contributor Author

forki commented Dec 15, 2016

I'm trying to measure this and it's not making huge impact as is on a full compile. But from what I can in VS debug it's definitely doing a lot less work for name resolution. This is especially important for suggestion errors.

@forki forki force-pushed the CollectAtMostOneResult branch from 90f4fc8 to 293b69b Compare December 15, 2016 18:34
@forki
Copy link
Contributor Author

forki commented Dec 15, 2016

made it an emu

@KevinRansom KevinRansom merged commit 9b4c4aa into dotnet:master Dec 15, 2016
@forki
Copy link
Contributor Author

forki commented Dec 15, 2016 via email

@forki forki deleted the CollectAtMostOneResult branch December 16, 2016 09:59
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.

3 participants