-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Extend the existing memoization of NSString's Hashable conformance to cover AnyObjects that are actually NSStrings as well #82440
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
… cover AnyObjects that are actually NSStrings as well
@swift-ci please test |
@swift-ci please Apple Silicon benchmark |
@swift-ci please benchmark |
@swift-ci please test |
@swift-ci please benchmark |
@swift-ci please benchmark |
@swift-ci please test |
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 looks entirely reasonable now. Does this show the performance shift you were looking for?
I've verified in lldb that we no longer hit |
@swift-ci please Apple Silicon benchmark |
Turns out we don't have benchmark coverage for AnyHashable! A local test shows ~18.6% overhead from the conformance lookups |
Test failure is clang crashing while trying to compile LLVM, looks like |
Verified with a release build locally: 4s -> 3s for 10M iterations |
@swift-ci please test |
Fixes rdar://154123172 (Consider memoizing the lookup for NSString's conformance to Hashable)