Skip to content

Conversation

DmT021
Copy link
Contributor

@DmT021 DmT021 commented Aug 15, 2025

This reverts commit 7989dbe merged in #82818

@DmT021
Copy link
Contributor Author

DmT021 commented Aug 15, 2025

@swift-ci Please test

@tbkka tbkka enabled auto-merge August 16, 2025 00:08
@tbkka tbkka merged commit 3451abc into swiftlang:main Aug 16, 2025
4 of 5 checks passed
DmT021 added a commit to DmT021/swift that referenced this pull request Aug 28, 2025
This change adds a new type of cache (cache by type descriptor) to the protocol conformance lookup system. This optimization is beneficial for generic types, where the
same conformance can be reused across different instantiations of the generic type.

Key changes:
- Add a `GetOrInsertManyScope` class to `ConcurrentReadableHashMap` for performing
  multiple insertions under a single lock
- Add type descriptor-based caching for protocol conformances
- Add environment variables for controlling and debugging the conformance cache
- Add tests to verify the behavior of the conformance cache
- Fix for swiftlang#82889

The implementation is controlled by the `SWIFT_DEBUG_ENABLE_CACHE_PROTOCOL_CONFORMANCES_BY_TYPE_DESCRIPTOR`
environment variable, which is enabled by default.

This reapplies swiftlang#82818 after it's been reverted in swiftlang#83770.
DmT021 added a commit to DmT021/swift that referenced this pull request Aug 29, 2025
This change adds a new type of cache (cache by type descriptor) to the protocol conformance lookup system. This optimization is beneficial for generic types, where the
same conformance can be reused across different instantiations of the generic type.

Key changes:
- Add a `GetOrInsertManyScope` class to `ConcurrentReadableHashMap` for performing
  multiple insertions under a single lock
- Add type descriptor-based caching for protocol conformances
- Add environment variables for controlling and debugging the conformance cache
- Add tests to verify the behavior of the conformance cache
- Fix for swiftlang#82889

The implementation is controlled by the `SWIFT_DEBUG_ENABLE_CACHE_PROTOCOL_CONFORMANCES_BY_TYPE_DESCRIPTOR`
environment variable, which is enabled by default.

This reapplies swiftlang#82818 after it's been reverted in swiftlang#83770.
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