Skip to content

Optimize signature relationship checks#15519

Merged
ahejlsberg merged 1 commit into
masterfrom
optimizeSignatureRelations
May 2, 2017
Merged

Optimize signature relationship checks#15519
ahejlsberg merged 1 commit into
masterfrom
optimizeSignatureRelations

Conversation

@ahejlsberg
Copy link
Copy Markdown
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
Copy Markdown
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