Skip to content

Remove stdlib and runtime dependencies on Foundation and CF #27155

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
merged 1 commit into from
Sep 13, 2019

Conversation

Catfish-Man
Copy link
Contributor

@Catfish-Man Catfish-Man commented Sep 12, 2019

Relanding #26630, with some fixes and improvements (now also decouples from CF properly!)

Fixes rdar://34198279

@Catfish-Man Catfish-Man self-assigned this Sep 12, 2019
@Catfish-Man
Copy link
Contributor Author

@swift-ci please test

@Catfish-Man
Copy link
Contributor Author

@swift-ci please benchmark

@swift-ci
Copy link
Contributor

Performance: -O

Regression OLD NEW DELTA RATIO
LessSubstringSubstring 40 45 +12.5% 0.89x
EqualSubstringSubstringGenericEquatable 40 45 +12.5% 0.89x
EqualSubstringString 40 45 +12.5% 0.89x
LessSubstringSubstringGenericComparable 40 45 +12.5% 0.89x
ObjectiveCBridgeStubFromNSDateRef 3820 4220 +10.5% 0.91x (?)
EqualSubstringSubstring 41 45 +9.8% 0.91x
String.data.Medium 87 94 +8.0% 0.93x (?)
 
Improvement OLD NEW DELTA RATIO
IterateData 1444 1315 -8.9% 1.10x (?)
RandomShuffleLCG2 768 704 -8.3% 1.09x
RemoveWhereMoveInts 37 34 -8.1% 1.09x (?)
Array2D 7520 6928 -7.9% 1.09x (?)
RemoveWhereSwapInts 65 60 -7.7% 1.08x (?)
MapReduce 398 369 -7.3% 1.08x
FlattenListLoop 5199 4833 -7.0% 1.08x (?)
MapReduceAnyCollection 398 370 -7.0% 1.08x
Set.subtracting.Empty.Box 15 14 -6.7% 1.07x (?)

Code size: -O

Performance: -Osize

Regression OLD NEW DELTA RATIO
LessSubstringSubstring 40 45 +12.5% 0.89x
EqualSubstringString 40 45 +12.5% 0.89x
LessSubstringSubstringGenericComparable 40 45 +12.5% 0.89x
ObjectiveCBridgeStubFromNSDateRef 3720 4140 +11.3% 0.90x (?)
SortLettersInPlace 515 569 +10.5% 0.91x (?)
EqualSubstringSubstring 41 45 +9.8% 0.91x
EqualStringSubstring 41 45 +9.8% 0.91x
EqualSubstringSubstringGenericEquatable 41 45 +9.8% 0.91x
 
Improvement OLD NEW DELTA RATIO
UTF8Decode_InitFromData_ascii 257 236 -8.2% 1.09x (?)
Data.hash.Empty 74 68 -8.1% 1.09x (?)
Array2D 7520 6928 -7.9% 1.09x
NSStringConversion.UTF8 840 775 -7.7% 1.08x (?)
UTF8Decode_InitFromBytes_ascii 327 302 -7.6% 1.08x (?)
RemoveWhereMoveInts 40 37 -7.5% 1.08x (?)
RemoveWhereSwapInts 67 62 -7.5% 1.08x (?)
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 98500 91500 -7.1% 1.08x (?)
ObjectiveCBridgeFromNSSetAnyObjectToString 77500 72000 -7.1% 1.08x (?)
FlattenListLoop 5284 4919 -6.9% 1.07x (?)

Code size: -Osize

Performance: -Onone

Regression OLD NEW DELTA RATIO
FrequenciesUsingReduceInto 3983 4485 +12.6% 0.89x (?)
Data.hash.Small 333 364 +9.3% 0.91x (?)
ObjectiveCBridgeStubFromNSDateRef 4310 4710 +9.3% 0.92x (?)
EqualSubstringSubstringGenericEquatable 46 50 +8.7% 0.92x (?)
LessSubstringSubstringGenericComparable 46 50 +8.7% 0.92x (?)
 
Improvement OLD NEW DELTA RATIO
ArrayOfPOD 1147 1066 -7.1% 1.08x (?)

Code size: -swiftlibs

Improvement OLD NEW DELTA RATIO
libswiftXPC.dylib 16384 12288 -25.0% 1.33x
libswiftOpenCL.dylib 16384 12288 -25.0% 1.33x
libswiftCoreFoundation.dylib 16384 12288 -25.0% 1.33x
libswiftSwiftPrivateThreadExtras.dylib 20480 16384 -20.0% 1.25x
libswiftObjectiveC.dylib 20480 16384 -20.0% 1.25x
libswiftos.dylib 32768 28672 -12.5% 1.14x
libswiftSwiftReflectionTest.dylib 32768 28672 -12.5% 1.14x
libswiftOSLogPrototype.dylib 40960 36864 -10.0% 1.11x
libswiftSwiftPrivate.dylib 45056 40960 -9.1% 1.10x
libswiftSwiftLang.dylib 94208 90112 -4.3% 1.05x
libswiftSwiftOnoneSupport.dylib 184320 180224 -2.2% 1.02x
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

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 33a00434f6ae542034affb6ff5f51ca506514bcb

@Catfish-Man
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 33a00434f6ae542034affb6ff5f51ca506514bcb

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 33a00434f6ae542034affb6ff5f51ca506514bcb

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 33a00434f6ae542034affb6ff5f51ca506514bcb

@Catfish-Man
Copy link
Contributor Author

@swift-ci please test osx platform

@Catfish-Man
Copy link
Contributor Author

@swift-ci please test os x platform

@Catfish-Man Catfish-Man merged commit b8fb2e5 into swiftlang:master Sep 13, 2019
/// Convert to an NSArray.
///
/// - Precondition: `Element` is bridged to Objective-C.
///
/// - Complexity: O(1).
@inlinable
@usableFromInline
Copy link
Member

@milseman milseman Sep 13, 2019

Choose a reason for hiding this comment

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

I know this seems pedantic, but could you add a comment after the @usableFromInline? Something to the effect of:

@usableFromInline // was @inlinable through Swift 5.1 (see comment below)

I want some indication right on the decl of the binary compatibility story, without reading comments inside the body (which may be about the implementation).

Copy link
Contributor

@stephentyrone stephentyrone Sep 13, 2019

Choose a reason for hiding this comment

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

Can we also mark these deprecated at this point, with a message that explains why they're there and not to use them?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can we mark things as deprecated without breaking our own/Foundation's callsites?

@milseman
Copy link
Member

Congrats!

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.

4 participants