Skip to content

Context flag for with statements to avoid parent pointer walks#17900

Closed
weswigham wants to merge 1 commit into
microsoft:masterfrom
weswigham:use-context-flag-for-with-contexts
Closed

Context flag for with statements to avoid parent pointer walks#17900
weswigham wants to merge 1 commit into
microsoft:masterfrom
weswigham:use-context-flag-for-with-contexts

Conversation

@weswigham
Copy link
Copy Markdown
Member

@weswigham weswigham commented Aug 18, 2017

We use isInWithStatementBody as a bailout condition all over the place in the checker - the most frequent places being at the top of getTypeOfNode and inside getContextualType. However it comes at a steep cost, as we are pretty much never within a with statement body (they're not even valid syntax in strict mode), so we always walk all the way up to the containing source file.

@weswigham
Copy link
Copy Markdown
Member Author

@Andy-MS You have a similar change out that does a similar thing for the ambient context, do you have any opinions about this?

@ghost
Copy link
Copy Markdown

ghost commented Aug 18, 2017

Duplicate of #17721?
Note that I only saw a 1% improvement -- you may have to run again to see if your perf tests give reliable results.

@weswigham weswigham closed this Aug 18, 2017
@weswigham
Copy link
Copy Markdown
Member Author

@Andy-MS Absolutely a duplicate, closed.

@weswigham weswigham removed request for a user, ahejlsberg and rbuckton August 18, 2017 19:51
@weswigham weswigham deleted the use-context-flag-for-with-contexts branch August 18, 2017 19:51
@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.

2 participants