Skip to content

Fix some low-hanging request evaluator performance fruit [5.2] #29089

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

Merged

Conversation

slavapestov
Copy link
Contributor

We've added a lot of new requests lately and converted more of the declaration checker to use requests. This has led to an increase in per-request overhead. This PR addresses some of this overhead:

  • Don't build the request dependency graph by default since it's currently only used for debugging
  • Look for a cached result before checking for a cycle to avoid expensive AnyRequest allocation

…ld-request-dependency-graph

This adds a measurable amount of runtime overhead, but it's only
needed for debugging.
This improves performance in the common case where the result has
already been cached, because the cycle check constructs an
AnyRequest existential, which is expensive.
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

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

This is okay for 5.2 because the dependency edges aren't used for anything other than debugging. We're going to do something different on master, where we have more runway to optimize the AnyRequest implementation.

@slavapestov slavapestov merged commit 880e9e6 into swiftlang:swift-5.2-branch Jan 9, 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