Skip to content

[metadata prespecialization] Reenable for stdlib. #31262

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

nate-chandler
Copy link
Contributor

Whenever building the stdlib for a supported platform, enable metadata prespecialization for it.

Whenever building the stdlib for a supported platform, enable metadata
prespecialization for it.
@nate-chandler
Copy link
Contributor Author

@swift-ci please test

@nate-chandler
Copy link
Contributor Author

@swift-ci please test source compatibility

@nate-chandler
Copy link
Contributor Author

@swift-ci please benchmark

@swift-ci
Copy link
Contributor

Performance: -O

Regression OLD NEW DELTA RATIO
EqualSubstringSubstring 23 30 +30.4% 0.77x
LessSubstringSubstring 23 30 +30.4% 0.77x
EqualStringSubstring 23 30 +30.4% 0.77x
EqualSubstringSubstringGenericEquatable 23 30 +30.4% 0.77x
EqualSubstringString 23 30 +30.4% 0.77x
LessSubstringSubstringGenericComparable 23 30 +30.4% 0.77x
UTF8Decode_InitDecoding 142 169 +19.0% 0.84x
UTF8Decode_InitFromCustom_contiguous 141 167 +18.4% 0.84x
StringComparison_longSharedPrefix 324 358 +10.5% 0.91x (?)
UTF8Decode_InitFromCustom_noncontiguous 276 303 +9.8% 0.91x (?)
SortStringsUnicode 2035 2230 +9.6% 0.91x (?)
StringHasSuffixAscii 1370 1500 +9.5% 0.91x (?)
UTF8Decode_InitFromData 159 172 +8.2% 0.92x (?)
 
Improvement OLD NEW DELTA RATIO
DropLastAnySequenceLazy 2765 2250 -18.6% 1.23x
SuffixAnySequenceLazy 2909 2513 -13.6% 1.16x (?)
RemoveWhereSwapInts 43 38 -11.6% 1.13x (?)
DictionaryOfAnyHashableStrings_insert 3640 3276 -10.0% 1.11x (?)
MapReduceAnyCollection 238 216 -9.2% 1.10x (?)
FlattenListLoop 3162 2870 -9.2% 1.10x (?)
DistinctClassFieldAccesses 201 183 -9.0% 1.10x (?)
DictionaryOfAnyHashableStrings_lookup 2952 2712 -8.1% 1.09x (?)
ArrayPlusEqualFiveElementCollection 5254 4847 -7.7% 1.08x (?)
String.replaceSubrange.RepChar.Small 290 268 -7.6% 1.08x (?)
SequenceAlgosAnySequence 28400 26300 -7.4% 1.08x (?)
PrefixWhileSequence 191 177 -7.3% 1.08x (?)
ArraySetElement 305 284 -6.9% 1.07x (?)

Code size: -O

Performance: -Osize

Regression OLD NEW DELTA RATIO
EqualSubstringSubstring 23 31 +34.8% 0.74x
LessSubstringSubstring 23 31 +34.8% 0.74x
EqualStringSubstring 23 31 +34.8% 0.74x
EqualSubstringSubstringGenericEquatable 23 31 +34.8% 0.74x
EqualSubstringString 23 31 +34.8% 0.74x
LessSubstringSubstringGenericComparable 23 31 +34.8% 0.74x
UTF8Decode_InitDecoding 139 169 +21.6% 0.82x (?)
UTF8Decode_InitFromCustom_contiguous 140 169 +20.7% 0.83x
StringComparison_longSharedPrefix 322 356 +10.6% 0.90x (?)
UTF8Decode_InitFromCustom_noncontiguous 274 302 +10.2% 0.91x (?)
SubstringFromLongStringGeneric 12 13 +8.3% 0.92x (?)
 
Improvement OLD NEW DELTA RATIO
PrefixAnySequence 3225 2540 -21.2% 1.27x
StringInterpolationManySmallSegments 11100 8800 -20.7% 1.26x (?)
DropFirstAnySequence 3496 2865 -18.0% 1.22x
DropLastAnySequenceLazy 3014 2500 -17.1% 1.21x
SuffixAnySequenceLazy 3243 2823 -13.0% 1.15x
String.replaceSubrange.RepChar.Small 293 264 -9.9% 1.11x (?)
RangeAssignment 227 210 -7.5% 1.08x (?)
Array2D 4544 4208 -7.4% 1.08x (?)

Code size: -Osize

Performance: -Onone

Regression OLD NEW DELTA RATIO
EqualSubstringSubstring 27 35 +29.6% 0.77x
EqualStringSubstring 28 36 +28.6% 0.78x
EqualSubstringString 28 36 +28.6% 0.78x
EqualSubstringSubstringGenericEquatable 27 34 +25.9% 0.79x
LessSubstringSubstringGenericComparable 27 34 +25.9% 0.79x
LessSubstringSubstring 28 35 +25.0% 0.80x
UTF8Decode_InitDecoding 146 178 +21.9% 0.82x
UTF8Decode_InitFromCustom_contiguous 151 180 +19.2% 0.84x
ObjectiveCBridgeStringHash 72 78 +8.3% 0.92x (?)
UTF8Decode_InitFromBytes 170 183 +7.6% 0.93x (?)
 
Improvement OLD NEW DELTA RATIO
DropWhileSequence 8716 5546 -36.4% 1.57x
SequenceAlgosUnfoldSequence 4080 2620 -35.8% 1.56x
DropFirstSequenceLazy 6295 4070 -35.3% 1.55x
DropFirstAnySequenceLazy 6605 4305 -34.8% 1.53x
DropFirstSequence 6200 4061 -34.5% 1.53x
PrefixAnySequenceLazy 5613 3696 -34.2% 1.52x
PrefixSequenceLazy 5059 3348 -33.8% 1.51x
PrefixAnySequence 6151 4117 -33.1% 1.49x
DropWhileAnySequence 9346 6277 -32.8% 1.49x
DropWhileSequenceLazy 8010 5386 -32.8% 1.49x
PrefixSequence 4967 3364 -32.3% 1.48x
DropWhileAnySequenceLazy 8311 5703 -31.4% 1.46x
MapReduceLazySequence 12881 8859 -31.2% 1.45x
DropFirstAnySequence 7104 4953 -30.3% 1.43x
PrefixWhileSequenceLazy 7146 5088 -28.8% 1.40x
PrefixWhileAnySequenceLazy 7474 5328 -28.7% 1.40x
Set.isStrictSubset.Empty.Int 350 272 -22.3% 1.29x
Dictionary3 440 343 -22.0% 1.28x
Set.isSubset.Int.Empty 206 161 -21.8% 1.28x
Set.isStrictSubset.Int.Empty 214 168 -21.5% 1.27x
SuffixAnySequence 10789 8514 -21.1% 1.27x
SuffixSequence 10830 8579 -20.8% 1.26x
StringRemoveDupes 675 537 -20.4% 1.26x (?)
SuffixAnySequenceLazy 11120 8864 -20.3% 1.25x
SuffixSequenceLazy 10751 8597 -20.0% 1.25x
DropLastAnySequenceLazy 11923 9720 -18.5% 1.23x
DropLastSequenceLazy 11501 9378 -18.5% 1.23x
DropLastAnySequence 11528 9403 -18.4% 1.23x
DropLastSequence 11469 9367 -18.3% 1.22x
ArrayOfGenericPOD2 656 554 -15.5% 1.18x (?)
Set.isDisjoint.Seq.Empty.Int 243 206 -15.2% 1.18x
Set.isDisjoint.Empty.Int 322 274 -14.9% 1.18x
Dictionary2 905 775 -14.4% 1.17x (?)
Set.isStrictSuperset.Seq.Empty.Int 911 783 -14.1% 1.16x
DictionaryRemove 9960 8610 -13.6% 1.16x
Data.append.Sequence.64kB.Count0.RE.I 19256 16752 -13.0% 1.15x
Data.append.Sequence.809B.Count0.RE 23955 20843 -13.0% 1.15x (?)
Dictionary4 704 613 -12.9% 1.15x (?)
Data.append.Sequence.809B.Count.RE.I 23930 20887 -12.7% 1.15x (?)
Set.isDisjoint.Seq.Int.Empty 426 372 -12.7% 1.15x
Set.isSubset.Empty.Int 279 245 -12.2% 1.14x (?)
Data.append.Sequence.64kB.Count.RE 19203 16864 -12.2% 1.14x
Data.init.Sequence.809B.Count0.RE 23686 20818 -12.1% 1.14x
Set.isSubset.Seq.Int.Empty 769 676 -12.1% 1.14x (?)
Set.subtracting.Seq.Empty.Int 367 323 -12.0% 1.14x (?)
Data.init.Sequence.64kB.Count0.RE.I 19024 16752 -11.9% 1.14x
Data.init.Sequence.809B.Count.RE.I 23671 20894 -11.7% 1.13x (?)
FatCompactMap 296330 261580 -11.7% 1.13x (?)
Data.append.Sequence.809B.Count.RE 23455 20744 -11.6% 1.13x (?)
Data.append.Sequence.64kB.Count.RE.I 19002 16808 -11.5% 1.13x (?)
Set.isDisjoint.Int.Empty 434 384 -11.5% 1.13x (?)
Data.init.Sequence.64kB.Count0.RE 18915 16757 -11.4% 1.13x
Data.init.Sequence.809B.Count.RE 23592 20916 -11.3% 1.13x (?)
Data.append.Sequence.809B.Count0.RE.I 23387 20761 -11.2% 1.13x (?)
Data.append.Sequence.64kB.Count0.RE 19005 16873 -11.2% 1.13x (?)
Set.isStrictSubset.Seq.Int.Empty 760 675 -11.2% 1.13x (?)
SetUnionInt100 280 249 -11.1% 1.12x (?)
DictionaryBridgeToObjC_Access 645 575 -10.9% 1.12x (?)
MapReduceSequence 28832 25715 -10.8% 1.12x (?)
String.replaceSubrange.RepChar.Small 299 267 -10.7% 1.12x (?)
Histogram 6060 5417 -10.6% 1.12x (?)
Dict.CopyKeyValue.24k 4034 3606 -10.6% 1.12x (?)
Dict.CopyKeyValue.28k 5289 4749 -10.2% 1.11x (?)
Set.subtracting.Empty.Int 79 71 -10.1% 1.11x (?)
DictionaryOfAnyHashableStrings_insert 5292 4760 -10.1% 1.11x (?)
Dict.CopyKeyValue.20k 3427 3083 -10.0% 1.11x (?)
Dictionary4OfObjects 1001 902 -9.9% 1.11x (?)
Dict.CopyKeyValue.16k 2874 2590 -9.9% 1.11x (?)
Data.init.Sequence.64kB.Count.RE 18873 17013 -9.9% 1.11x (?)
DataAppendSequence 2359300 2127400 -9.8% 1.11x (?)
PrefixWhileAnySequence 17577 15871 -9.7% 1.11x (?)
Dictionary4Legacy 848 766 -9.7% 1.11x (?)
ArrayAppendRepeatCol 226920 205790 -9.3% 1.10x (?)
FindString.Rec3.Array 9446 8571 -9.3% 1.10x (?)
Dictionary4OfObjectsLegacy 1183 1076 -9.0% 1.10x (?)
Set.isSuperset.Seq.Empty.Int 378 344 -9.0% 1.10x (?)
CharacterLiteralsLarge 378 344 -9.0% 1.10x (?)
Data.init.Sequence.809B.Count0.RE.I 23837 21739 -8.8% 1.10x (?)
PrefixWhileSequence 17599 16054 -8.8% 1.10x (?)
SetUnionInt50 388 354 -8.8% 1.10x (?)
Data.init.Sequence.64kB.Count.RE.I 18709 17075 -8.7% 1.10x (?)
Set.subtracting.Int.Empty 106 97 -8.5% 1.09x (?)
Set.isStrictSubset.Int0 438 402 -8.2% 1.09x (?)
SetIsSubsetInt0 431 396 -8.1% 1.09x (?)
DictionaryOfAnyHashableStrings_lookup 3408 3144 -7.7% 1.08x (?)
SetUnionInt25 432 400 -7.4% 1.08x (?)
DictionarySwap 3192 2960 -7.3% 1.08x (?)
MapReduceLazyCollection 25043 23239 -7.2% 1.08x (?)
Prims.NonStrongRef.UnownedUnsafe 1460 1355 -7.2% 1.08x (?)
Set.isDisjoint.Int100 641 596 -7.0% 1.08x (?)
Prims.NonStrongRef.UnownedUnsafe.Closure 1466 1368 -6.7% 1.07x (?)

Code size: -swiftlibs

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 mini
  Model Identifier: Macmini8,1
  Processor Name: 6-Core Intel Core i7
  Processor Speed: 3.2 GHz
  Number of Processors: 1
  Total Number of Cores: 6
  L2 Cache (per Core): 256 KB
  L3 Cache: 12 MB
  Memory: 64 GB

@nate-chandler
Copy link
Contributor Author

@swift-ci please test source compatibility

1 similar comment
@nate-chandler
Copy link
Contributor Author

@swift-ci please test source compatibility

@nate-chandler
Copy link
Contributor Author

@swift-ci please test source compatibility release

@nate-chandler nate-chandler merged commit 7ae3d38 into swiftlang:master Apr 27, 2020
@nate-chandler nate-chandler deleted the generic-metadata-prespecialization-components/on-for-stdlib branch April 27, 2020 16:29
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