Skip to content

[ABI] Associated conformance resilience #19358

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

DougGregor
Copy link
Member

Implement resilience for the associated conformances of a protocol, e.g., the SubSequence: Collection requirement of the Collection protocol. This involves the usual steps:

  • Define an associated conformance descriptor for each associated conformance requirement
  • Use that associated conformance descriptor to compute the index into the witness table when the protocol is treated resiliently
  • TODO: Emit associated conformances as part of the resilient witness table for resilient protocols

Associated conformance descriptors are aliases that refer to associated
conformance requirements within a protocol descriptor’s list of
requirements. They will be used to provide protocol resilience against
the addition of new associated conformance requirements (which only makes 
sense for newly-introduced, defaulted associated types).
When referencing an associated conformance in a witness table for a
resilient protocol, use the associated conformance descriptor to compute
the index into the witness table at run-time.

Another part of rdar://problem/44167982.
@DougGregor
Copy link
Member Author

@swift-ci please test

@DougGregor
Copy link
Member Author

@swift-ci please benchmark

@swift-ci
Copy link
Contributor

Build comment file:

Performance: -O

TEST OLD NEW DELTA RATIO
Regression
IterateData 1570 1737 +10.6% 0.90x (?)
Improvement
DictionaryKeysContainsCocoa 49 42 -14.3% 1.17x

Performance: -Osize

TEST OLD NEW DELTA RATIO
Regression
IterateData 1629 1824 +12.0% 0.89x

Performance: -Onone

TEST OLD NEW DELTA RATIO
Improvement
ArrayOfPOD 858 781 -9.0% 1.10x (?)
PointerArithmetics 439997 403866 -8.2% 1.09x
How to read the data The tables contain differences in performance which are larger than 8% and differences in code size which are larger than 1%.

If you see any unexpected regressions, you should consider fixing the regressions before you merge the PR.

Noise: Sometimes the performance results (not code size!) contain false alarms. Unexpected regressions which are marked with '(?)' are probably noise. If you see regressions which you cannot explain you can try to run the benchmarks again. If regressions still show up, please consult with the performance team (@eeckstein).

Hardware Overview
  Model Name: Mac Pro
  Model Identifier: MacPro6,1
  Processor Name: 12-Core Intel Xeon E5
  Processor Speed: 2.7 GHz
  Number of Processors: 1
  Total Number of Cores: 12
  L2 Cache (per Core): 256 KB
  L3 Cache: 30 MB
  Memory: 64 GB

@DougGregor DougGregor merged commit 17f5bef into swiftlang:master Sep 18, 2018
@DougGregor DougGregor deleted the associated-conformance-resilience branch September 18, 2018 03:27
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