Skip to content

Skip unnecessary type and symbol instantiations#21470

Merged
ahejlsberg merged 1 commit into
masterfrom
optimizeInstantiation
Jan 30, 2018
Merged

Skip unnecessary type and symbol instantiations#21470
ahejlsberg merged 1 commit into
masterfrom
optimizeInstantiation

Conversation

@ahejlsberg
Copy link
Copy Markdown
Member

This PR optimizes type instantiation as follows:

  • During instantiation of a symbol, if the type of the symbol has already been resolved and if that type is one that is never affected by instantiation, just return the symbol itself.
  • During instantiation of a type reference, union type, or intersection type, only create a new type if something changes when instantiating the constituent type list.

Haven't measured effects on performance, but it certainly removes unnecessary work and causes fewer symbols to be created.

@ahejlsberg ahejlsberg requested a review from mhegazy January 30, 2018 01:26
@RyanCavanaugh
Copy link
Copy Markdown
Member

LGTM

@ahejlsberg ahejlsberg merged commit 6be98fa into master Jan 30, 2018
@ahejlsberg ahejlsberg deleted the optimizeInstantiation branch January 30, 2018 14:39
@microsoft microsoft locked and limited conversation to collaborators Jul 3, 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