-
Notifications
You must be signed in to change notification settings - Fork 10.6k
[cxx-interop] Improve performance of synthesized iterator conformances #84853
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
base: main
Are you sure you want to change the base?
Conversation
@swift-ci please test |
2affa19
to
f6a989d
Compare
@swift-ci please test |
Nice finding, Egor! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to fix the out-of-memory issue in the bootstrap jobs. There is still a separate failure in the SIL verifier.
When conforming a C++ iterator type to the `UnsafeCxxInputIterator` protocol, we try to instantiate `operator==` for the given type, which is one of the requirements of the protocol. The logic that did name lookup was unintentionally running a global lookup for `==` across all of the visible Clang modules, which became a performance issue. This happened because ClangImporter was doing a name lookup in the fake `__ObjC` module instead of the actual owning Clang module for the iterator type. rdar://162125326 / resolves swiftlang#84733
f6a989d
to
4f0bd8b
Compare
This depends on #84877 |
@swift-ci please test |
@swift-ci please benchmark macOS |
@swift-ci please benchmark |
When conforming a C++ iterator type to the
UnsafeCxxInputIterator
protocol, we try to instantiateoperator==
for the given type, which is one of the requirements of the protocol.The logic that did name lookup was unintentionally running a global lookup for
==
across all of the visible Clang modules, which became a performance issue. This happened because ClangImporter was doing a name lookup in the fake__ObjC
module instead of the actual owning Clang module for the iterator type.rdar://162125326 / resolves #84733