Skip to content

Only obtain regular type of fresh object literal type if necessary#4716

Merged
ahejlsberg merged 2 commits into
masterfrom
optimizeFreshTypeRelation
Sep 10, 2015
Merged

Only obtain regular type of fresh object literal type if necessary#4716
ahejlsberg merged 2 commits into
masterfrom
optimizeFreshTypeRelation

Conversation

@ahejlsberg
Copy link
Copy Markdown
Member

During type relalationship processing we currently obtain the regular (non-fresh) version of an object literal type after performing the excess property check. There's no reason to do this unless the type being compared against is a union or intersection type (which it rarely is). This PR implements that simple optimization.

No new tests in this PR as no behaviors change. Only difference is that we allocate fewer type instances.

@DanielRosenwasser
Copy link
Copy Markdown
Member

As discussed offline, the optimization of caching with regularType in FreshObjectLiteralType was actually not being done, so let's do that in this review as well.

@DanielRosenwasser
Copy link
Copy Markdown
Member

👍

ahejlsberg added a commit that referenced this pull request Sep 10, 2015
Only obtain regular type of fresh object literal type if necessary
@ahejlsberg ahejlsberg merged commit aa434a1 into master Sep 10, 2015
@ahejlsberg ahejlsberg deleted the optimizeFreshTypeRelation branch September 10, 2015 23:14
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 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