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

Optimize signature relationship checks #15519

Merged
merged 1 commit into from
May 2, 2017
Merged

Conversation

ahejlsberg
Copy link
Member

This PR optimizes signature relationship checks in instantiations of the same type. In general, when comparing signatures from two types we perform N * M comparisons which becomes quite expensive in types with many signatures (such as the types of methods with many overloads). In #12548 we added a number of new overloads in Array<T> which caused a severe regression when structurally comparing array-like types (such as tuples). Now, when comparing signatures from instantiations of the same type, we simply compare the two lists of signatures pairwise. This reduces the check time for the example in #15470 from 7-8s to 0.4s.

Fixes #15470.

@ahejlsberg ahejlsberg merged commit 41b9f74 into master May 2, 2017
@ahejlsberg ahejlsberg deleted the optimizeSignatureRelations branch May 2, 2017 00:13
@mhegazy
Copy link
Contributor

mhegazy commented May 8, 2017

Ported to release-2.3 in 5c56b4c

@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants