Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

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

Conversation

weswigham
Copy link
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
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

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
Member Author

@Andy-MS Absolutely a duplicate, closed.

@weswigham weswigham removed request for rbuckton, ahejlsberg and a user 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