Skip to content

[stdlib][WIP] Factor out common parts of pointer types and de-gyb #17951

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 2 commits into from
Jul 14, 2018

Conversation

airspeedswift
Copy link
Member

Redo of #17628

There is a lot of boilerplate across Unsafe{Raw}{Mutable}Pointer that can instead be done via protocol extensions on the already-existing _Pointer protocol, since it's all identical and only relies on access to the underlying builtin pointer. This reduces the actual code to the point where it makes sense to de-gyb the file. Since most of this code is transparent anyway, it should make little difference to performance.

@airspeedswift
Copy link
Member Author

@swift-ci please test

@airspeedswift
Copy link
Member Author

@swift-ci please smoke benchmark

@swift-ci
Copy link
Contributor

Build comment file:

Optimized (O)

Regression (21)
TEST OLD NEW DELTA SPEEDUP
StringWithCString 46336 125118 +170.0% 0.37x
COWArrayGuaranteedParameterOverhead 8761 11046 +26.1% 0.79x
BinaryFloatingPointPropertiesBinade 25 31 +24.0% 0.81x
RangeIterationSigned 171 200 +17.0% 0.86x
ObjectiveCBridgeToNSDictionary 26168 30372 +16.1% 0.86x
DataReplaceSmallBuffer 8688 9845 +13.3% 0.88x
StringEqualPointerComparison 286 314 +9.8% 0.91x
PointerArithmetics 31505 34352 +9.0% 0.92x
DataCount 34 37 +8.8% 0.92x
Calculator 193 209 +8.3% 0.92x
StringBuilder 461 497 +7.8% 0.93x
DictionarySwapAt 6715 7239 +7.8% 0.93x
MapReduceAnyCollection 372 399 +7.3% 0.93x (?)
RemoveWhereMoveInts 14 15 +7.1% 0.93x
ObjectiveCBridgeFromNSStringForced 2721 2908 +6.9% 0.94x (?)
RangeAssignment 336 359 +6.8% 0.94x
DataAppendDataMediumToMedium 6708 7162 +6.8% 0.94x (?)
StringWordBuilderReservingCapacity 1885 2012 +6.7% 0.94x
StringBuilderSmallReservingCapacity 475 506 +6.5% 0.94x
StringHashing_abnormal 1359 1443 +6.2% 0.94x
DropLastSequenceLazy 640 676 +5.6% 0.95x
Improvement (38)
TEST OLD NEW DELTA SPEEDUP
DataAppendDataSmallToLarge 44767 21854 -51.2% 2.05x (?)
Sim2DArray 669 417 -37.7% 1.60x
StaticArray 11 9 -18.2% 1.22x
RemoveWhereFilterString 283 242 -14.5% 1.17x
ObjectiveCBridgeFromNSArrayAnyObjectForced 5983 5145 -14.0% 1.16x
ChainedFilterMap 1409 1245 -11.6% 1.13x
FatCompactMap 1409 1248 -11.4% 1.13x
CharIteration_utf16_unicodeScalars_Backwards 19431 17704 -8.9% 1.10x
SuffixCountableRange 12 11 -8.3% 1.09x
MapReduceLazyCollectionShort 37 34 -8.1% 1.09x
UTF8Decode_InitFromBytes_ascii 536 494 -7.8% 1.09x (?)
PopFrontUnsafePointer 9516 8796 -7.6% 1.08x (?)
RC4 161 149 -7.5% 1.08x
SubstringComparable 14 13 -7.1% 1.08x
MapReduce 398 371 -6.8% 1.07x
ObjectiveCBridgeToNSSet 17811 16727 -6.1% 1.06x
AngryPhonebook 3772 3544 -6.0% 1.06x
ObjectiveCBridgeStubNSDataAppend 2688 2533 -5.8% 1.06x
NopDeinit 31965 30171 -5.6% 1.06x
CharIteration_ascii_unicodeScalars_Backwards 15599 14738 -5.5% 1.06x
CharIteration_japanese_unicodeScalars_Backwards 18668 17639 -5.5% 1.06x
CharIteration_tweet_unicodeScalars_Backwards 30790 29110 -5.5% 1.06x
ObjectiveCBridgeFromNSArrayAnyObjectToString 47871 45274 -5.4% 1.06x (?)
BinaryFloatingPointPropertiesUlp 37 35 -5.4% 1.06x
CharIteration_russian_unicodeScalars_Backwards 12990 12288 -5.4% 1.06x
CharIteration_chinese_unicodeScalars_Backwards 11806 11168 -5.4% 1.06x
CharIteration_korean_unicodeScalars_Backwards 15113 14313 -5.3% 1.06x
CharIteration_tweet_unicodeScalars 42320 40087 -5.3% 1.06x
CharIteration_punctuated_unicodeScalars_Backwards 3536 3350 -5.3% 1.06x
CharIndexing_ascii_unicodeScalars 17166 16264 -5.3% 1.06x
CharIteration_punctuatedJapanese_unicodeScalars_Backwards 2827 2681 -5.2% 1.05x
CharIndexing_korean_unicodeScalars 16649 15791 -5.2% 1.05x
CharIndexing_japanese_unicodeScalars 20538 19495 -5.1% 1.05x
StringWordBuilder 2421 2299 -5.0% 1.05x
CharIndexing_russian_unicodeScalars 14300 13580 -5.0% 1.05x
CharIndexing_chinese_unicodeScalars 12993 12346 -5.0% 1.05x
RandomDoubleLCG 2291 2177 -5.0% 1.05x
SumUsingReduceInto 102 97 -4.9% 1.05x
No Changes (399)
TEST OLD NEW DELTA SPEEDUP
AnyHashableWithAClass 90820 91157 +0.4% 1.00x
Array2D 2842 2858 +0.6% 0.99x (?)
ArrayAppend 1086 1075 -1.0% 1.01x (?)
ArrayAppendArrayOfInt 798 796 -0.3% 1.00x
ArrayAppendAscii 4037 3951 -2.1% 1.02x (?)
ArrayAppendAsciiSubstring 25400 25055 -1.4% 1.01x
ArrayAppendFromGeneric 797 807 +1.3% 0.99x
ArrayAppendGenericStructs 1430 1430 +0.0% 1.00x
ArrayAppendLatin1 42017 41587 -1.0% 1.01x
ArrayAppendLatin1Substring 142824 141604 -0.9% 1.01x
ArrayAppendLazyMap 1345 1332 -1.0% 1.01x
ArrayAppendOptionals 1430 1403 -1.9% 1.02x (?)
ArrayAppendRepeatCol 1338 1336 -0.1% 1.00x (?)
ArrayAppendReserved 813 805 -1.0% 1.01x
ArrayAppendSequence 1121 1122 +0.1% 1.00x
ArrayAppendStrings 6341 6331 -0.2% 1.00x (?)
ArrayAppendToFromGeneric 799 803 +0.5% 1.00x
ArrayAppendToGeneric 800 800 +0.0% 1.00x
ArrayAppendUTF16 41819 41127 -1.7% 1.02x
ArrayAppendUTF16Substring 140874 139516 -1.0% 1.01x
ArrayInClass 85 85 +0.0% 1.00x
ArrayLiteral 0 0 +0.0% 1.00x
ArrayOfGenericPOD2 151 152 +0.7% 0.99x (?)
ArrayOfGenericRef 4439 4414 -0.6% 1.01x (?)
ArrayOfPOD 184 184 +0.0% 1.00x
ArrayOfRef 4405 4390 -0.3% 1.00x (?)
ArrayPlusEqualArrayOfInt 801 785 -2.0% 1.02x (?)
ArrayPlusEqualFiveElementCollection 5438 5415 -0.4% 1.00x
ArrayPlusEqualSingleElementCollection 1086 1077 -0.8% 1.01x
ArrayPlusEqualThreeElements 1658 1663 +0.3% 1.00x (?)
ArraySubscript 1554 1581 +1.7% 0.98x
ArrayValueProp 8 8 +0.0% 1.00x
ArrayValueProp2 8 8 +0.0% 1.00x
ArrayValueProp3 8 8 +0.0% 1.00x
ArrayValueProp4 8 8 +0.0% 1.00x
BinaryFloatingPointPropertiesNextUp 28 28 +0.0% 1.00x
BitCount 202 211 +4.5% 0.96x
ByteSwap 104 107 +2.9% 0.97x
COWTree 3648 3615 -0.9% 1.01x (?)
CSVParsing 654411 656372 +0.3% 1.00x (?)
CSVParsingAlt 818094 812844 -0.6% 1.01x (?)
CSVParsingAltIndices 342606 339618 -0.9% 1.01x
CStringLongAscii 4124 4120 -0.1% 1.00x (?)
CStringLongNonAscii 2391 2388 -0.1% 1.00x
CStringShortAscii 3381 3339 -1.2% 1.01x
CaptureProp 4119 4101 -0.4% 1.00x (?)
CharIndexing_ascii_unicodeScalars_Backwards 16459 16043 -2.5% 1.03x
CharIndexing_chinese_unicodeScalars_Backwards 12465 12131 -2.7% 1.03x
CharIndexing_japanese_unicodeScalars_Backwards 19694 19204 -2.5% 1.03x
CharIndexing_korean_unicodeScalars_Backwards 15966 15501 -2.9% 1.03x
CharIndexing_punctuatedJapanese_unicodeScalars 3103 2961 -4.6% 1.05x
CharIndexing_punctuatedJapanese_unicodeScalars_Backwards 2980 2920 -2.0% 1.02x
CharIndexing_punctuated_unicodeScalars 3882 3702 -4.6% 1.05x
CharIndexing_punctuated_unicodeScalars_Backwards 3728 3664 -1.7% 1.02x
CharIndexing_russian_unicodeScalars_Backwards 13719 13385 -2.4% 1.02x
CharIndexing_tweet_unicodeScalars 33117 32074 -3.1% 1.03x
CharIndexing_tweet_unicodeScalars_Backwards 32277 31803 -1.5% 1.01x
CharIndexing_utf16_unicodeScalars 23150 22874 -1.2% 1.01x
CharIndexing_utf16_unicodeScalars_Backwards 23426 23302 -0.5% 1.01x
CharIteration_ascii_unicodeScalars 21401 20611 -3.7% 1.04x
CharIteration_chinese_unicodeScalars 16189 15582 -3.7% 1.04x
CharIteration_japanese_unicodeScalars 25658 24664 -3.9% 1.04x
CharIteration_korean_unicodeScalars 20729 19987 -3.6% 1.04x
CharIteration_punctuatedJapanese_unicodeScalars 3832 3697 -3.5% 1.04x
CharIteration_punctuated_unicodeScalars 4797 4645 -3.2% 1.03x
CharIteration_russian_unicodeScalars 17863 17161 -3.9% 1.04x
CharIteration_utf16_unicodeScalars 27986 27729 -0.9% 1.01x
CharacterLiteralsLarge 5893 5873 -0.3% 1.00x (?)
CharacterLiteralsSmall 220 217 -1.4% 1.01x
CharacterPropertiesFetch 4600 4617 +0.4% 1.00x (?)
CharacterPropertiesPrecomputed 1001 1002 +0.1% 1.00x (?)
CharacterPropertiesStashed 1523 1520 -0.2% 1.00x (?)
CharacterPropertiesStashedMemo 1550 1554 +0.3% 1.00x (?)
Chars 1020 1017 -0.3% 1.00x
ClassArrayGetter 15 15 +0.0% 1.00x
Combos 495 496 +0.2% 1.00x
DataAccessBytes 1145 1151 +0.5% 0.99x (?)
DataAppendArray 5328 5403 +1.4% 0.99x (?)
DataAppendBytes 5007 5196 +3.8% 0.96x
DataAppendDataLargeToLarge 68028 68386 +0.5% 0.99x (?)
DataAppendDataLargeToMedium 35624 35609 -0.0% 1.00x (?)
DataAppendDataLargeToSmall 34845 34382 -1.3% 1.01x
DataAppendDataMediumToLarge 22352 22212 -0.6% 1.01x (?)
DataAppendDataMediumToSmall 6060 5977 -1.4% 1.01x (?)
DataAppendDataSmallToMedium 6075 6276 +3.3% 0.97x (?)
DataAppendDataSmallToSmall 6158 6067 -1.5% 1.01x (?)
DataAppendSequence 20603 20479 -0.6% 1.01x (?)
DataCopyBytes 448 466 +4.0% 0.96x (?)
DataMutateBytes 3928 3987 +1.5% 0.99x (?)
DataReplaceLarge 37182 37035 -0.4% 1.00x (?)
DataReplaceLargeBuffer 58499 59727 +2.1% 0.98x (?)
DataReplaceMedium 7712 8050 +4.4% 0.96x (?)
DataReplaceMediumBuffer 12095 11672 -3.5% 1.04x (?)
DataReplaceSmall 5760 5786 +0.5% 1.00x (?)
DataReset 2878 2783 -3.3% 1.03x (?)
DataSetCount 550 558 +1.5% 0.99x (?)
DataSubscript 220 220 +0.0% 1.00x
DictOfArraysToArrayOfDicts 792 799 +0.9% 0.99x (?)
Dictionary 513 509 -0.8% 1.01x
Dictionary2 640 640 +0.0% 1.00x
Dictionary2OfObjects 2084 2087 +0.1% 1.00x (?)
Dictionary3 221 224 +1.4% 0.99x
Dictionary3OfObjects 732 735 +0.4% 1.00x (?)
Dictionary4 325 321 -1.2% 1.01x
Dictionary4Legacy 703 703 +0.0% 1.00x
Dictionary4OfObjects 440 437 -0.7% 1.01x
Dictionary4OfObjectsLegacy 919 907 -1.3% 1.01x (?)
DictionaryBridge 1269 1297 +2.2% 0.98x (?)
DictionaryBridgeToObjC_Access 1013 987 -2.6% 1.03x (?)
DictionaryBridgeToObjC_Bridge 19 19 +0.0% 1.00x
DictionaryBridgeToObjC_BulkAccess 165 167 +1.2% 0.99x (?)
DictionaryCopy 107259 107948 +0.6% 0.99x
DictionaryFilter 106914 107105 +0.2% 1.00x (?)
DictionaryGroup 220 220 +0.0% 1.00x
DictionaryGroupOfObjects 2133 2138 +0.2% 1.00x (?)
DictionaryKeysContainsCocoa 40 40 +0.0% 1.00x
DictionaryKeysContainsNative 32 32 +0.0% 1.00x
DictionaryLiteral 1889 1902 +0.7% 0.99x
DictionaryOfObjects 2384 2372 -0.5% 1.01x
DictionaryRemove 4198 4271 +1.7% 0.98x (?)
DictionaryRemoveOfObjects 25905 25989 +0.3% 1.00x
DictionarySubscriptDefaultMutation 267 266 -0.4% 1.00x (?)
DictionarySubscriptDefaultMutationArray 621 623 +0.3% 1.00x (?)
DictionarySubscriptDefaultMutationArrayOfObjects 4022 4032 +0.2% 1.00x (?)
DictionarySubscriptDefaultMutationOfObjects 1703 1715 +0.7% 0.99x (?)
DictionarySwap 1043 1039 -0.4% 1.00x
DictionarySwapAtOfObjects 51883 52588 +1.4% 0.99x (?)
DictionarySwapOfObjects 8894 8901 +0.1% 1.00x (?)
DoubleWidthDivision 0 0 +0.0% 1.00x
DropFirstAnyCollection 76 76 +0.0% 1.00x
DropFirstAnyCollectionLazy 65287 65054 -0.4% 1.00x (?)
DropFirstAnySeqCRangeIter 93 93 +0.0% 1.00x
DropFirstAnySeqCRangeIterLazy 93 93 +0.0% 1.00x
DropFirstAnySeqCntRange 71 71 +0.0% 1.00x
DropFirstAnySeqCntRangeLazy 71 71 +0.0% 1.00x
DropFirstAnySequence 1842 1841 -0.1% 1.00x (?)
DropFirstAnySequenceLazy 1841 1843 +0.1% 1.00x (?)
DropFirstArray 35 35 +0.0% 1.00x
DropFirstArrayLazy 35 35 +0.0% 1.00x
DropFirstCountableRange 35 35 +0.0% 1.00x
DropFirstCountableRangeLazy 35 35 +0.0% 1.00x
DropFirstSequence 2682 2681 -0.0% 1.00x (?)
DropFirstSequenceLazy 2776 2775 -0.0% 1.00x
DropLastAnyCollection 28 28 +0.0% 1.00x
DropLastAnyCollectionLazy 21761 22052 +1.3% 0.99x (?)
DropLastAnySeqCRangeIter 3337 3305 -1.0% 1.01x
DropLastAnySeqCRangeIterLazy 3335 3306 -0.9% 1.01x
DropLastAnySeqCntRange 11 11 +0.0% 1.00x
DropLastAnySeqCntRangeLazy 11 11 +0.0% 1.00x
DropLastAnySequence 4941 4961 +0.4% 1.00x (?)
DropLastAnySequenceLazy 5035 5042 +0.1% 1.00x (?)
DropLastCountableRange 11 11 +0.0% 1.00x
DropLastCountableRangeLazy 11 11 +0.0% 1.00x
DropLastSequence 642 674 +5.0% 0.95x
DropWhileAnyCollection 100 100 +0.0% 1.00x
DropWhileAnyCollectionLazy 130 130 +0.0% 1.00x
DropWhileAnySeqCRangeIter 75 75 +0.0% 1.00x
DropWhileAnySeqCRangeIterLazy 130 130 +0.0% 1.00x
DropWhileAnySeqCntRange 95 95 +0.0% 1.00x
DropWhileAnySeqCntRangeLazy 130 130 +0.0% 1.00x
DropWhileAnySequence 1861 1862 +0.1% 1.00x
DropWhileAnySequenceLazy 1854 1855 +0.1% 1.00x (?)
DropWhileArrayLazy 88 88 +0.0% 1.00x
DropWhileCountableRange 36 36 +0.0% 1.00x
DropWhileCountableRangeLazy 105 105 +0.0% 1.00x
DropWhileSequence 2221 2219 -0.1% 1.00x
DropWhileSequenceLazy 88 88 +0.0% 1.00x
EqualStringSubstring 50 49 -2.0% 1.02x
EqualSubstringString 51 49 -3.9% 1.04x
EqualSubstringSubstring 50 49 -2.0% 1.02x
EqualSubstringSubstringGenericEquatable 50 49 -2.0% 1.02x
ErrorHandling 1225 1207 -1.5% 1.01x (?)
ExclusivityGlobal 5 5 +0.0% 1.00x
ExclusivityIndependent 2 2 +0.0% 1.00x
FilterEvenUsingReduce 1344 1319 -1.9% 1.02x
FilterEvenUsingReduceInto 163 159 -2.5% 1.03x
FloatingPointPrinting_Double_description_small 21950 21563 -1.8% 1.02x
FloatingPointPrinting_Double_description_uniform 21253 21079 -0.8% 1.01x
FloatingPointPrinting_Double_interpolated 62723 63112 +0.6% 0.99x (?)
FloatingPointPrinting_Float80_description_small 28481 28251 -0.8% 1.01x
FloatingPointPrinting_Float80_description_uniform 27720 27598 -0.4% 1.00x (?)
FloatingPointPrinting_Float80_interpolated 65941 65535 -0.6% 1.01x (?)
FloatingPointPrinting_Float_description_small 5638 5504 -2.4% 1.02x
FloatingPointPrinting_Float_description_uniform 5270 5316 +0.9% 0.99x
FloatingPointPrinting_Float_interpolated 38835 39284 +1.2% 0.99x (?)
FrequenciesUsingReduce 4934 4902 -0.6% 1.01x (?)
FrequenciesUsingReduceInto 1507 1539 +2.1% 0.98x
Hanoi 2281 2219 -2.7% 1.03x
HashTest 957 962 +0.5% 0.99x (?)
Histogram 661 649 -1.8% 1.02x
Integrate 340 342 +0.6% 0.99x
IterateData 1441 1451 +0.7% 0.99x
Join 171 170 -0.6% 1.01x
LazilyFilteredArrayContains 37468 36660 -2.2% 1.02x
LazilyFilteredArrays 66732 66668 -0.1% 1.00x (?)
LazilyFilteredRange 3878 3886 +0.2% 1.00x (?)
LessSubstringSubstring 50 48 -4.0% 1.04x
LessSubstringSubstringGenericComparable 50 49 -2.0% 1.02x
LinkedList 7528 7520 -0.1% 1.00x (?)
LuhnAlgoEager 449 450 +0.2% 1.00x (?)
LuhnAlgoLazy 448 451 +0.7% 0.99x (?)
MapReduceAnyCollectionShort 2059 2035 -1.2% 1.01x
MapReduceClass 3001 3007 +0.2% 1.00x (?)
MapReduceClassShort 4571 4555 -0.4% 1.00x (?)
MapReduceLazyCollection 13 13 +0.0% 1.00x
MapReduceLazySequence 86 86 +0.0% 1.00x
MapReduceSequence 475 462 -2.7% 1.03x (?)
MapReduceShort 2022 2030 +0.4% 1.00x (?)
MapReduceShortString 21 21 +0.0% 1.00x
MapReduceString 51 51 +0.0% 1.00x
Memset 219 220 +0.5% 1.00x (?)
MonteCarloE 10180 10317 +1.3% 0.99x
MonteCarloPi 42785 42763 -0.1% 1.00x
NSDictionaryCastToSwift 7378 7556 +2.4% 0.98x (?)
NSError 164 166 +1.2% 0.99x (?)
NSStringConversion 702 686 -2.3% 1.02x
NibbleSort 3705 3687 -0.5% 1.00x
ObjectAllocation 133 133 +0.0% 1.00x
ObjectiveCBridgeFromNSArrayAnyObject 25075 26113 +4.1% 0.96x (?)
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 44798 44691 -0.2% 1.00x (?)
ObjectiveCBridgeFromNSDictionaryAnyObject 116293 111170 -4.4% 1.05x (?)
ObjectiveCBridgeFromNSSetAnyObject 48970 50493 +3.1% 0.97x (?)
ObjectiveCBridgeFromNSSetAnyObjectForced 5123 5093 -0.6% 1.01x (?)
ObjectiveCBridgeFromNSSetAnyObjectToString 73259 69848 -4.7% 1.05x
ObjectiveCBridgeFromNSString 1273 1236 -2.9% 1.03x (?)
ObjectiveCBridgeStubDataAppend 6371 6470 +1.6% 0.98x (?)
ObjectiveCBridgeStubDateMutation 401 401 +0.0% 1.00x
ObjectiveCBridgeStubFromArrayOfNSString 32721 33639 +2.8% 0.97x (?)
ObjectiveCBridgeStubFromNSDate 6567 6559 -0.1% 1.00x (?)
ObjectiveCBridgeStubFromNSString 1046 1031 -1.4% 1.01x (?)
ObjectiveCBridgeStubFromNSStringRef 159 158 -0.6% 1.01x
ObjectiveCBridgeStubNSDateMutationRef 13179 13512 +2.5% 0.98x (?)
ObjectiveCBridgeStubToArrayOfNSString 40348 39535 -2.0% 1.02x (?)
ObjectiveCBridgeStubToNSDate 15743 15559 -1.2% 1.01x (?)
ObjectiveCBridgeStubToNSDateRef 3421 3443 +0.6% 0.99x (?)
ObjectiveCBridgeStubToNSString 2349 2363 +0.6% 0.99x (?)
ObjectiveCBridgeStubToNSStringRef 115 113 -1.7% 1.02x
ObjectiveCBridgeStubURLAppendPath 283679 280116 -1.3% 1.01x (?)
ObjectiveCBridgeStubURLAppendPathRef 282710 273117 -3.4% 1.04x
ObjectiveCBridgeToNSArray 14787 14805 +0.1% 1.00x (?)
ObjectiveCBridgeToNSString 452 453 +0.2% 1.00x
ObserverClosure 2158 2162 +0.2% 1.00x (?)
ObserverForwarderStruct 1198 1206 +0.7% 0.99x (?)
ObserverPartiallyAppliedMethod 3743 3726 -0.5% 1.00x (?)
ObserverUnappliedMethod 2458 2448 -0.4% 1.00x
OpaqueConsumingUsers 4180 4179 -0.0% 1.00x (?)
OpenClose 68 71 +4.4% 0.96x
PartialApplyDynamicType 0 0 +0.0% 1.00x
Phonebook 7056 7011 -0.6% 1.01x
PolymorphicCalls 25 25 +0.0% 1.00x
PopFrontArray 1963 1982 +1.0% 0.99x (?)
PopFrontArrayGeneric 1988 1903 -4.3% 1.04x (?)
PrefixAnyCollection 76 76 +0.0% 1.00x
PrefixAnyCollectionLazy 65416 64840 -0.9% 1.01x (?)
PrefixAnySeqCRangeIter 40 40 +0.0% 1.00x
PrefixAnySeqCRangeIterLazy 40 40 +0.0% 1.00x
PrefixAnySeqCntRange 71 71 +0.0% 1.00x
PrefixAnySeqCntRangeLazy 71 71 +0.0% 1.00x
PrefixAnySequence 1379 1378 -0.1% 1.00x (?)
PrefixAnySequenceLazy 1378 1381 +0.2% 1.00x
PrefixArray 35 35 +0.0% 1.00x
PrefixArrayLazy 35 35 +0.0% 1.00x
PrefixCountableRange 35 35 +0.0% 1.00x
PrefixCountableRangeLazy 35 35 +0.0% 1.00x
PrefixSequence 2224 2224 +0.0% 1.00x
PrefixSequenceLazy 2276 2277 +0.0% 1.00x (?)
PrefixWhileAnyCollection 147 147 +0.0% 1.00x
PrefixWhileAnyCollectionLazy 71 71 +0.0% 1.00x
PrefixWhileAnySeqCRangeIter 386 388 +0.5% 0.99x
PrefixWhileAnySeqCRangeIterLazy 89 89 +0.0% 1.00x
PrefixWhileAnySeqCntRange 142 142 +0.0% 1.00x
PrefixWhileAnySeqCntRangeLazy 71 71 +0.0% 1.00x
PrefixWhileAnySequence 1544 1541 -0.2% 1.00x
PrefixWhileAnySequenceLazy 1392 1391 -0.1% 1.00x (?)
PrefixWhileArray 88 88 +0.0% 1.00x
PrefixWhileArrayLazy 70 70 +0.0% 1.00x
PrefixWhileCountableRange 36 36 +0.0% 1.00x
PrefixWhileCountableRangeLazy 35 35 +0.0% 1.00x
PrefixWhileSequence 362 362 +0.0% 1.00x
PrefixWhileSequenceLazy 52 52 +0.0% 1.00x
Prims 921 918 -0.3% 1.00x (?)
PrimsSplit 923 919 -0.4% 1.00x (?)
QueueConcrete 1154 1154 +0.0% 1.00x
QueueGeneric 1139 1140 +0.1% 1.00x
RGBHistogram 3010 2973 -1.2% 1.01x
RGBHistogramOfObjects 23762 23737 -0.1% 1.00x (?)
Radix2CooleyTukey 12434 12439 +0.0% 1.00x (?)
Radix2CooleyTukeyf 9139 8965 -1.9% 1.02x
RandomDoubleDef 26804 26591 -0.8% 1.01x
RandomIntegersDef 24541 24468 -0.3% 1.00x (?)
RandomIntegersLCG 173 173 +0.0% 1.00x
RandomShuffleDef 813906 814507 +0.1% 1.00x (?)
RandomShuffleLCG 57756 57351 -0.7% 1.01x (?)
RangeReplaceableCollectionPlusDefault 1088 1073 -1.4% 1.01x (?)
RecursiveOwnedParameter 115 115 +0.0% 1.00x
RemoveWhereFilterInts 47 47 +0.0% 1.00x
RemoveWhereFilterStrings 437 437 +0.0% 1.00x
RemoveWhereMoveStrings 709 708 -0.1% 1.00x
RemoveWhereQuadraticInts 1293 1297 +0.3% 1.00x
RemoveWhereQuadraticString 385 376 -2.3% 1.02x (?)
RemoveWhereQuadraticStrings 2758 2765 +0.3% 1.00x
RemoveWhereSwapInts 19 20 +5.3% 0.95x
RemoveWhereSwapStrings 859 859 +0.0% 1.00x
ReversedArray 57 57 +0.0% 1.00x
ReversedBidirectional 17001 17165 +1.0% 0.99x
ReversedDictionary 268 270 +0.7% 0.99x (?)
RomanNumbers 85467 85961 +0.6% 0.99x
SequenceAlgosAnySequence 12227 12030 -1.6% 1.02x
SequenceAlgosArray 1579 1578 -0.1% 1.00x
SequenceAlgosContiguousArray 1577 1578 +0.1% 1.00x (?)
SequenceAlgosList 1347 1347 +0.0% 1.00x
SequenceAlgosRange 2577 2579 +0.1% 1.00x (?)
SequenceAlgosUnfoldSequence 1102 1103 +0.1% 1.00x (?)
SetExclusiveOr 5168 5062 -2.1% 1.02x
SetExclusiveOr_OfObjects 11740 11776 +0.3% 1.00x
SetIntersect 694 699 +0.7% 0.99x (?)
SetIntersect_OfObjects 1815 1790 -1.4% 1.01x
SetIsSubsetOf 344 343 -0.3% 1.00x
SetIsSubsetOf_OfObjects 439 437 -0.5% 1.00x
SetUnion 4452 4341 -2.5% 1.03x
SetUnion_OfObjects 10167 10152 -0.1% 1.00x (?)
SevenBoom 850 846 -0.5% 1.00x (?)
SortLargeExistentials 5527 5594 +1.2% 0.99x
SortLettersInPlace 992 1007 +1.5% 0.99x (?)
SortSortedStrings 864 873 +1.0% 0.99x
SortStrings 1787 1816 +1.6% 0.98x
SortStringsUnicode 2586 2598 +0.5% 1.00x
StackPromo 24443 24364 -0.3% 1.00x (?)
StrComplexWalk 1777 1780 +0.2% 1.00x
StrToInt 3230 3265 +1.1% 0.99x
StringAdder 561 552 -1.6% 1.02x
StringBuilderLong 1271 1252 -1.5% 1.02x (?)
StringBuilderWithLongSubstring 1511 1508 -0.2% 1.00x (?)
StringComparison_abnormal 832 800 -3.8% 1.04x
StringComparison_ascii 1028 1034 +0.6% 0.99x
StringComparison_emoji 867 849 -2.1% 1.02x
StringComparison_fastPrenormal 854 852 -0.2% 1.00x
StringComparison_latin1 666 668 +0.3% 1.00x
StringComparison_longSharedPrefix 958 956 -0.2% 1.00x
StringComparison_nonBMPSlowestPrenormal 1710 1657 -3.1% 1.03x
StringComparison_slowerPrenormal 1837 1788 -2.7% 1.03x
StringComparison_zalgo 112237 112123 -0.1% 1.00x (?)
StringEdits 172815 169521 -1.9% 1.02x (?)
StringEnumRawValueInitialization 930 921 -1.0% 1.01x
StringFromLongWholeSubstring 21 21 +0.0% 1.00x
StringFromLongWholeSubstringGeneric 21 21 +0.0% 1.00x
StringHasPrefixAscii 2261 2262 +0.0% 1.00x (?)
StringHasPrefixUnicode 99087 99569 +0.5% 1.00x
StringHasSuffixAscii 2375 2319 -2.4% 1.02x
StringHasSuffixUnicode 102508 100629 -1.8% 1.02x
StringHashing_ascii 34 34 +0.0% 1.00x
StringHashing_emoji 1944 1890 -2.8% 1.03x (?)
StringHashing_fastPrenormal 8446 8482 +0.4% 1.00x (?)
StringHashing_latin1 2586 2618 +1.2% 0.99x (?)
StringHashing_longSharedPrefix 8002 7761 -3.0% 1.03x
StringHashing_nonBMPSlowestPrenormal 2125 2059 -3.1% 1.03x (?)
StringHashing_slowerPrenormal 2739 2773 +1.2% 0.99x
StringHashing_zalgo 3536 3507 -0.8% 1.01x
StringInterpolation 9658 9396 -2.7% 1.03x (?)
StringInterpolationManySmallSegments 18520 18624 +0.6% 0.99x (?)
StringInterpolationSmall 4319 4335 +0.4% 1.00x
StringMatch 12407 12194 -1.7% 1.02x
StringRemoveDupes 483 482 -0.2% 1.00x (?)
StringUTF16Builder 2656 2669 +0.5% 1.00x (?)
StringUTF16SubstringBuilder 6289 6101 -3.0% 1.03x (?)
StringWalk 1550 1563 +0.8% 0.99x
SubstringEqualString 610 610 +0.0% 1.00x
SubstringEquatable 1439 1424 -1.0% 1.01x
SubstringFromLongString 10 10 +0.0% 1.00x
SubstringFromLongStringGeneric 74 74 +0.0% 1.00x
SuffixAnyCollection 28 28 +0.0% 1.00x
SuffixAnyCollectionLazy 21918 21565 -1.6% 1.02x
SuffixAnySeqCRangeIter 3633 3601 -0.9% 1.01x
SuffixAnySeqCRangeIterLazy 3626 3600 -0.7% 1.01x
SuffixAnySeqCntRange 17 17 +0.0% 1.00x
SuffixAnySeqCntRangeLazy 17 17 +0.0% 1.00x
SuffixAnySequence 4926 4948 +0.4% 1.00x
SuffixAnySequenceLazy 4993 5059 +1.3% 0.99x
SuffixCountableRangeLazy 11 11 +0.0% 1.00x
SuffixSequence 3617 3693 +2.1% 0.98x
SuffixSequenceLazy 3611 3665 +1.5% 0.99x (?)
SumUsingReduce 97 102 +5.2% 0.95x
SuperChars 20154 20280 +0.6% 0.99x
TwoSum 1483 1469 -0.9% 1.01x (?)
TypeFlood 0 0 +0.0% 1.00x
UTF8Decode 312 298 -4.5% 1.05x
UTF8Decode_InitDecoding 1370 1350 -1.5% 1.01x
UTF8Decode_InitDecoding_ascii 661 653 -1.2% 1.01x (?)
UTF8Decode_InitFromBytes 1186 1197 +0.9% 0.99x (?)
UTF8Decode_InitFromData 1264 1259 -0.4% 1.00x (?)
UTF8Decode_InitFromData_ascii 763 781 +2.4% 0.98x (?)
Walsh 432 435 +0.7% 0.99x
WordCountHistogramASCII 8250 8245 -0.1% 1.00x (?)
WordCountHistogramUTF16 11354 11376 +0.2% 1.00x (?)
WordCountUniqueASCII 2088 2103 +0.7% 0.99x (?)
WordCountUniqueUTF16 4630 4644 +0.3% 1.00x (?)
WordSplitASCII 9419 9722 +3.2% 0.97x (?)
WordSplitUTF16 10973 10771 -1.8% 1.02x
XorLoop 396 396 +0.0% 1.00x
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

@atrick
Copy link
Contributor

atrick commented Jul 14, 2018

Awesome. Thanks!

@airspeedswift
Copy link
Member Author

I think there's more simplification to be done but I'm going to land this on master now since the degybbing makes rebases painful.

@natecook1000 this will need some rethinking of how we phrase the docs for stuff that is shared between typed and untyped pointers.

@airspeedswift airspeedswift merged commit 436b861 into swiftlang:master Jul 14, 2018
@natecook1000
Copy link
Member

Hmm, this may end up causing doc problems because of the way we treat underscored things as quasi-private when it comes to visibility of docs and/or generated header. I'll take a look at how SourceKit vends these types after the change — is there a reason why Pointer needs to be underscored?

@airspeedswift
Copy link
Member Author

Ah. The main reason for the underscore is that it would need an evolution proposal to turn it from an implementation detail into a publicly-available protocol. And it's questionable whether that would be useful as a public protocol – not clear people outside the std lib need to write code that's generic over different kinds of pointers. They might though, I haven't thought about it much. But I'd rather not pursue that purely for doc generation reasons.

@atrick
Copy link
Contributor

atrick commented Jul 17, 2018

@airspeedswift actually the diagnostics are much better after your changes. The overload lists are shorter and now there's no mention of memory binding. We should never tell "normal" developers to use the memory binding APIs. They only make sense if you're writing a custom allocator in Swift. It's always better to redesign the user-side APIs to use correct pointer types and introduce C wrappers where needed.

@airspeedswift airspeedswift deleted the repointed branch August 18, 2018 17:16
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