Skip to content

Conversation

@gregomni
Copy link
Contributor

@gregomni gregomni commented Jun 13, 2020

ConstraintSystem node->type map requires ordering because it is a stack that can be partially undone, but Solution node->type map is all or nothing, so can be cheaper with just a DenseMap.

Impact is small, but this does save ~5% of the time in Sema for expressions with a whole lot of ASTNodes, such as array literals, e.g. https://bugs.swift.org/browse/SR-8314.

but Solution node->type map is all or nothing, so can be cheaper.
@gregomni
Copy link
Contributor Author

@swift-ci Please smoke test.

@gregomni gregomni requested a review from xedin June 13, 2020 19:52
@gregomni gregomni changed the title [NFC][Sema] Solution nodeTypes from MapVector to DenseMap. [Sema] Solution nodeTypes from MapVector to DenseMap. Jun 13, 2020
Copy link
Contributor

@xedin xedin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@xedin xedin merged commit 77d0919 into swiftlang:master Jun 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants