Skip to content

[DO NOT MERGE][stdlib] Make assert(), _debugPreconditions() noops #35065

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

Closed
wants to merge 2 commits into from

Conversation

lorentey
Copy link
Member

This is just an experiment to verify a potential optimization problem.

(If this patch affects performance benchmarks in any way, then my hare-brained theory in #34961 (comment) is probably correct.)

This is just an experiment to verify a potential optimization problem.
@lorentey
Copy link
Member Author

@swift-ci benchmark

@lorentey lorentey marked this pull request as draft December 11, 2020 20:52
@swift-ci
Copy link
Contributor

swift-ci commented Dec 11, 2020

Performance: -O

Regression OLD NEW DELTA RATIO
FlattenListLoop 1644 2520 +53.3% 0.65x (?)
ObjectiveCBridgeStringHash 110 140 +27.3% 0.79x
ObjectiveCBridgeStringGetASCIIContents 441 519 +17.7% 0.85x
FlattenListFlatMap 5477 6235 +13.8% 0.88x (?)
ObjectiveCBridgeStringCStringUsingEncoding 740 841 +13.6% 0.88x
InsertCharacterEndIndex 164 181 +10.4% 0.91x (?)
ObjectiveCBridgeStringCompare 1022 1119 +9.5% 0.91x
ObjectiveCBridgeStringCompare2 997 1090 +9.3% 0.91x
NSStringConversion.MutableCopy.Rebridge.LongUTF8 713 773 +8.4% 0.92x (?)
 
Improvement OLD NEW DELTA RATIO
DropLastAnySeqCRangeIterLazy 64227 32784 -49.0% 1.96x
SuffixAnySeqCRangeIterLazy 64918 33816 -47.9% 1.92x
SequenceAlgosAnySequence 38500 20200 -47.5% 1.91x
SuffixAnySeqCntRangeLazy 63730 33696 -47.1% 1.89x
DropLastAnySeqCntRangeLazy 63257 33965 -46.3% 1.86x
DropFirstAnyCollectionLazy 87102 61116 -29.8% 1.43x
SuffixAnyCollectionLazy 29629 21069 -28.9% 1.41x
PrefixAnyCollectionLazy 87051 62720 -28.0% 1.39x
DropLastAnyCollectionLazy 29180 21090 -27.7% 1.38x
StringFromLongWholeSubstring 5 4 -20.0% 1.25x
AngryPhonebook.ASCII2 189 154 -18.5% 1.23x
ArrayInitFromSlice 469 418 -10.9% 1.12x (?)
FindString.Loop1.Substring 547 500 -8.6% 1.09x (?)

Code size: -O

Performance: -Osize

Regression OLD NEW DELTA RATIO
ObjectiveCBridgeStringHash 110 139 +26.4% 0.79x
ObjectiveCBridgeStringGetASCIIContents 441 516 +17.0% 0.85x (?)
NSStringConversion.UTF8 747 867 +16.1% 0.86x (?)
StringToDataLargeUnicode 3700 4150 +12.2% 0.89x (?)
InsertCharacterEndIndex 164 181 +10.4% 0.91x (?)
ObjectiveCBridgeStringCompare2 998 1091 +9.3% 0.91x
ObjectiveCBridgeStringCompare 1033 1128 +9.2% 0.92x (?)
NSStringConversion.MutableCopy.Rebridge.LongUTF8 713 771 +8.1% 0.92x (?)
 
Improvement OLD NEW DELTA RATIO
SuffixAnySeqCRangeIterLazy 64880 33201 -48.8% 1.95x
DropLastAnySeqCRangeIterLazy 63797 32867 -48.5% 1.94x
SequenceAlgosAnySequence 38400 20100 -47.7% 1.91x
DropLastAnySeqCntRangeLazy 63656 33528 -47.3% 1.90x
SuffixAnySeqCntRangeLazy 62767 33559 -46.5% 1.87x
SortIntPyramid 1295 700 -45.9% 1.85x
FlattenListFlatMap 6191 4081 -34.1% 1.52x (?)
DropFirstAnyCollectionLazy 88278 62062 -29.7% 1.42x
PrefixAnyCollectionLazy 88318 62176 -29.6% 1.42x
DropLastAnyCollectionLazy 29472 21188 -28.1% 1.39x
SuffixAnyCollectionLazy 29532 21377 -27.6% 1.38x
SortAdjacentIntPyramids 1555 1155 -25.7% 1.35x
StringFromLongWholeSubstring 5 4 -20.0% 1.25x
AngryPhonebook.ASCII2 189 154 -18.5% 1.23x
ArrayInitFromSlice 471 419 -11.0% 1.12x (?)
FindString.Loop1.Substring 554 505 -8.8% 1.10x (?)
StringComparison_fastPrenormal 1040 960 -7.7% 1.08x
DataAccessBytesMedium 101 94 -6.9% 1.07x (?)

Code size: -Osize

Regression OLD NEW DELTA RATIO
SortLargeExistentials.o 20185 20467 +1.4% 0.99x
SortLettersInPlace.o 7653 7756 +1.3% 0.99x
SortIntPyramids.o 8714 8820 +1.2% 0.99x
 
Improvement OLD NEW DELTA RATIO
ReversedCollections.o 8128 7965 -2.0% 1.02x

Performance: -Onone

(Hidden because these are irrelevant)
Regression OLD NEW DELTA RATIO
ObjectiveCBridgeStringHash 110 140 +27.3% 0.79x
String.data.Small 96 116 +20.8% 0.83x (?)
String.data.Empty 94 111 +18.1% 0.85x (?)
ObjectiveCBridgeStringGetASCIIContents 443 515 +16.3% 0.86x (?)
DataAppendDataSmallToMedium 5900 6760 +14.6% 0.87x (?)
ObjectiveCBridgeStringCStringUsingEncoding 743 842 +13.3% 0.88x (?)
String.data.Medium 228 257 +12.7% 0.89x (?)
CStringLongAscii 382 430 +12.6% 0.89x (?)
Histogram 7566 8431 +11.4% 0.90x (?)
FindString.Rec3.String 839 928 +10.6% 0.90x (?)
FindString.Rec3.Substring 801 884 +10.4% 0.91x (?)
ObjectiveCBridgeStringCompare 1026 1130 +10.1% 0.91x
FloatingPointPrinting_Float_interpolated 72400 79600 +9.9% 0.91x (?)
ObjectiveCBridgeStringCompare2 989 1083 +9.5% 0.91x (?)
StringToDataSmall 4050 4400 +8.6% 0.92x (?)
DataAppendDataMediumToMedium 6200 6720 +8.4% 0.92x (?)
ArrayOfPOD 1054 1136 +7.8% 0.93x (?)
Dictionary2 1830 1970 +7.7% 0.93x (?)
 
Improvement OLD NEW DELTA RATIO
PrefixWhileCountableRange 47111 24054 -48.9% 1.96x
DropFirstAnySeqCRangeIterLazy 64337 33526 -47.9% 1.92x
PrefixAnyCollection 48704 25776 -47.1% 1.89x
SequenceAlgosRange 3829930 2041860 -46.7% 1.88x
DropLastAnyCollection 16265 8695 -46.5% 1.87x
PrefixWhileAnyCollection 94081 50605 -46.2% 1.86x
SequenceAlgosAnySequence 39300 21200 -46.1% 1.85x
DropFirstAnySeqCRangeIter 65243 35220 -46.0% 1.85x
DropFirstAnySeqCntRangeLazy 63564 34330 -46.0% 1.85x
SuffixAnyCollection 16107 8707 -45.9% 1.85x
SuffixAnySeqCRangeIter 64059 34792 -45.7% 1.84x
DropWhileCountableRange 16395 8909 -45.7% 1.84x
DropWhileAnyCollection 63006 34302 -45.6% 1.84x
DropLastAnySeqCntRangeLazy 65486 35713 -45.5% 1.83x
SuffixAnySeqCntRange 63320 34554 -45.4% 1.83x
SuffixAnySeqCRangeIterLazy 63908 34917 -45.4% 1.83x
DropLastAnySeqCntRange 65370 35745 -45.3% 1.83x
SuffixAnySeqCntRangeLazy 63630 34800 -45.3% 1.83x
PrefixAnySeqCRangeIter 51233 28129 -45.1% 1.82x
DropFirstAnySeqCntRange 64001 35217 -45.0% 1.82x
DropFirstAnyCollection 47446 26143 -44.9% 1.81x
DropLastAnySeqCRangeIter 65234 36205 -44.5% 1.80x
DropLastAnySeqCRangeIterLazy 65843 36673 -44.3% 1.80x
PrefixAnySeqCRangeIterLazy 49730 27942 -43.8% 1.78x
PrefixWhileAnySeqCRangeIter 50211 28288 -43.7% 1.77x
PrefixAnySeqCntRange 50776 28654 -43.6% 1.77x
LazilyFilteredRange 1625560 917640 -43.5% 1.77x
PrefixAnySeqCntRangeLazy 49773 28231 -43.3% 1.76x
DropWhileCountableRangeLazy 67967 38628 -43.2% 1.76x
PrefixWhileAnySeqCntRange 49900 28590 -42.7% 1.75x
DropWhileAnySeqCRangeIterLazy 68770 39424 -42.7% 1.74x
DropWhileAnyCollectionLazy 68879 39518 -42.6% 1.74x
DropWhileAnySeqCntRange 70364 40707 -42.1% 1.73x
DropWhileAnySeqCRangeIter 70265 40802 -41.9% 1.72x
DropWhileAnySeqCntRangeLazy 68999 40080 -41.9% 1.72x
PrefixWhileCountableRangeLazy 52489 30980 -41.0% 1.69x
PrefixWhileAnyCollectionLazy 52766 31166 -40.9% 1.69x
PrefixWhileAnySeqCntRangeLazy 52645 31195 -40.7% 1.69x
PrefixWhileAnySeqCRangeIterLazy 52215 31282 -40.1% 1.67x
ReversedBidirectional 109834 72958 -33.6% 1.51x
DictionaryGroup 8785 5842 -33.5% 1.50x
DropFirstCountableRangeLazy 79069 54750 -30.8% 1.44x
PrefixCountableRangeLazy 77538 55016 -29.0% 1.41x
DropLastCountableRangeLazy 25766 18379 -28.7% 1.40x
SuffixCountableRangeLazy 25766 18514 -28.1% 1.39x
RemoveWhereQuadraticInts 13419 9694 -27.8% 1.38x
RemoveWhereQuadraticStrings 15214 11576 -23.9% 1.31x
AngryPhonebook.ASCII2 191 157 -17.8% 1.22x
ArrayInitFromSlice 566 485 -14.3% 1.17x (?)
SuffixAnyCollectionLazy 54500 47502 -12.8% 1.15x (?)
ObjectiveCBridgeStubNSDateRefAccess 5610 5051 -10.0% 1.11x (?)
PopFrontArrayGeneric 5560 5020 -9.7% 1.11x
NibbleSort 699430 638580 -8.7% 1.10x (?)
DataCreateSmallArray 40800 37600 -7.8% 1.09x (?)
SortArrayInClass 46515 42953 -7.7% 1.08x

Code size: -swiftlibs

Improvement OLD NEW DELTA RATIO
libswiftSwiftOnoneSupport.dylib 163840 131072 -20.0% 1.25x
libswiftCore.dylib 4079616 4014080 -1.6% 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

@lorentey
Copy link
Member Author

Yep, this is not great.

@lorentey

This comment has been minimized.

1 similar comment
@lorentey
Copy link
Member Author

@swift-ci benchmark

@swift-ci
Copy link
Contributor

swift-ci commented Dec 12, 2020

Performance: -O

Regression OLD NEW DELTA RATIO
ObjectiveCBridgeStringHash 99 122 +23.2% 0.81x
ObjectiveCBridgeStubFromNSDateRef 4040 4760 +17.8% 0.85x (?)
ObjectiveCBridgeStringGetASCIIContents 396 462 +16.7% 0.86x
ObjectiveCBridgeStringCStringUsingEncoding 669 741 +10.8% 0.90x
ObjectiveCBridgeStringCompare2 899 977 +8.7% 0.92x
ObjectiveCBridgeStringCompare 925 1002 +8.3% 0.92x
 
Improvement OLD NEW DELTA RATIO
SequenceAlgosAnySequence 34600 17200 -50.3% 2.01x
DropLastAnySeqCntRangeLazy 56767 28692 -49.5% 1.98x
DropLastAnySeqCRangeIterLazy 56412 28622 -49.3% 1.97x
SuffixAnySeqCRangeIterLazy 56157 28606 -49.1% 1.96x
SuffixAnySeqCntRangeLazy 56070 28580 -49.0% 1.96x
PrefixAnyCollectionLazy 80105 54567 -31.9% 1.47x
DropFirstAnyCollectionLazy 78181 54126 -30.8% 1.44x
DropLastAnyCollectionLazy 26084 18434 -29.3% 1.41x
SuffixAnyCollectionLazy 26221 18539 -29.3% 1.41x
AngryPhonebook.ASCII2 169 138 -18.3% 1.22x
ArrayInitFromSlice 421 375 -10.9% 1.12x (?)
Breadcrumbs.UTF16ToIdxRange.longMixed 144 134 -6.9% 1.07x (?)
Breadcrumbs.IdxToUTF16Range.longMixed 503 469 -6.8% 1.07x (?)
FindString.Loop1.Substring 489 457 -6.5% 1.07x (?)

Code size: -O

Performance: -Osize

Regression OLD NEW DELTA RATIO
ObjectiveCBridgeStringHash 99 122 +23.2% 0.81x
ObjectiveCBridgeStringGetASCIIContents 399 457 +14.5% 0.87x
ObjectiveCBridgeStringCStringUsingEncoding 666 742 +11.4% 0.90x (?)
String.data.Medium 105 115 +9.5% 0.91x (?)
ObjectiveCBridgeToNSDictionary 14150 15450 +9.2% 0.92x (?)
ObjectiveCBridgeStringCompare 932 1013 +8.7% 0.92x
ObjectiveCBridgeStringCompare2 900 978 +8.7% 0.92x (?)
 
Improvement OLD NEW DELTA RATIO
SuffixAnySeqCRangeIterLazy 57567 28615 -50.3% 2.01x
DropLastAnySeqCRangeIterLazy 57650 28739 -50.1% 2.01x
SequenceAlgosAnySequence 34600 17300 -50.0% 2.00x
SuffixAnySeqCntRangeLazy 56598 28556 -49.5% 1.98x
DropLastAnySeqCntRangeLazy 57053 28946 -49.3% 1.97x
SortIntPyramid 1165 630 -45.9% 1.85x
PrefixAnyCollectionLazy 79720 54456 -31.7% 1.46x
DropFirstAnyCollectionLazy 78963 54748 -30.7% 1.44x
SuffixAnyCollectionLazy 26351 18372 -30.3% 1.43x
DropLastAnyCollectionLazy 26329 18432 -30.0% 1.43x
SortAdjacentIntPyramids 1400 1030 -26.4% 1.36x
AngryPhonebook.ASCII2 169 138 -18.3% 1.22x
StringComparison_fastPrenormal 940 860 -8.5% 1.09x
SubstringEqualString 378 350 -7.4% 1.08x
Breadcrumbs.UTF16ToIdxRange.longMixed 143 133 -7.0% 1.08x (?)

Code size: -Osize

Regression OLD NEW DELTA RATIO
SortLargeExistentials.o 20185 20467 +1.4% 0.99x
SortLettersInPlace.o 7653 7756 +1.3% 0.99x
SortIntPyramids.o 8714 8820 +1.2% 0.99x
 
Improvement OLD NEW DELTA RATIO
ReversedCollections.o 8128 7980 -1.8% 1.02x

Performance: -Onone

Debug performance isn't relevant; click here to see if you are curious
Regression OLD NEW DELTA RATIO
SevenBoom 1659 2237 +34.8% 0.74x (?)
StringBuilderWithLongSubstring 4280 5380 +25.7% 0.80x (?)
ObjectiveCBridgeStringHash 99 123 +24.2% 0.80x
DictionaryRemove 24650 29840 +21.1% 0.83x
NSError 747 900 +20.5% 0.83x (?)
DictionaryRemoveOfObjects 49500 58800 +18.8% 0.84x (?)
DataAppendDataSmallToMedium 5320 6180 +16.2% 0.86x (?)
DataToStringMedium 8550 9900 +15.8% 0.86x (?)
FindString.Rec3.Substring 719 825 +14.7% 0.87x (?)
StringToDataEmpty 3450 3950 +14.5% 0.87x (?)
ObjectiveCBridgeStringGetASCIIContents 397 454 +14.4% 0.87x (?)
Histogram 6764 7673 +13.4% 0.88x (?)
NSStringConversion.MutableCopy.Rebridge.LongUTF8 756 857 +13.4% 0.88x (?)
StringBuilderLong 2280 2580 +13.2% 0.88x (?)
DataAppendBytesMedium 5380 6080 +13.0% 0.88x (?)
Dictionary2 1640 1840 +12.2% 0.89x (?)
ObjectiveCBridgeStringCStringUsingEncoding 663 742 +11.9% 0.89x (?)
DataAppendDataSmallToSmall 5540 6200 +11.9% 0.89x (?)
NSStringConversion.MutableCopy.Rebridge 1201 1336 +11.2% 0.90x (?)
NSStringConversion.UTF8 2470 2742 +11.0% 0.90x (?)
NSStringConversion.Rebridge.Medium 319 353 +10.7% 0.90x (?)
NSStringConversion.Rebridge.Long 319 353 +10.7% 0.90x (?)
DataMutateBytesMedium 3980 4400 +10.6% 0.90x (?)
StringInterpolationSmall 4090 4500 +10.0% 0.91x (?)
FindString.Rec3.String 753 828 +10.0% 0.91x (?)
DataReplaceSmall 4200 4600 +9.5% 0.91x (?)
ObjectiveCBridgeStringCompare2 905 982 +8.5% 0.92x
ErrorHandling 4250 4610 +8.5% 0.92x (?)
ObjectiveCBridgeStringCompare 923 1000 +8.3% 0.92x (?)
ArrayOfPOD 919 994 +8.2% 0.92x (?)
CharacterPropertiesPrecomputed 2920 3140 +7.5% 0.93x (?)
 
Improvement OLD NEW DELTA RATIO
PrefixWhileAnyCollection 86592 42723 -50.7% 2.03x
DropFirstAnySeqCRangeIterLazy 58395 29388 -49.7% 1.99x
DropWhileAnyCollection 57260 28931 -49.5% 1.98x
SequenceAlgosRange 3439700 1744780 -49.3% 1.97x
SequenceAlgosAnySequence 35400 18000 -49.2% 1.97x
DropFirstAnyCollection 43006 21898 -49.1% 1.96x
DropFirstAnySeqCntRangeLazy 57716 29428 -49.0% 1.96x
SuffixAnyCollection 14333 7314 -49.0% 1.96x
DropLastAnyCollection 14293 7300 -48.9% 1.96x
PrefixAnyCollection 42682 21818 -48.9% 1.96x
DropFirstAnySeqCntRange 58286 29882 -48.7% 1.95x
PrefixWhileCountableRange 42155 21620 -48.7% 1.95x
SuffixAnySeqCntRange 57055 29270 -48.7% 1.95x
SuffixAnySeqCRangeIterLazy 57448 29665 -48.4% 1.94x
SuffixAnySeqCRangeIter 56832 29401 -48.3% 1.93x
DropFirstAnySeqCRangeIter 58414 30229 -48.3% 1.93x
DropWhileCountableRange 14719 7652 -48.0% 1.92x
SuffixAnySeqCntRangeLazy 57019 29687 -47.9% 1.92x
DropLastAnySeqCRangeIterLazy 59885 31241 -47.8% 1.92x
DropLastAnySeqCRangeIter 59117 31001 -47.6% 1.91x
DropLastAnySeqCntRange 58572 30833 -47.4% 1.90x
DropLastAnySeqCntRangeLazy 59344 31370 -47.1% 1.89x
PrefixWhileAnySeqCRangeIter 45208 23958 -47.0% 1.89x
PrefixAnySeqCRangeIterLazy 45188 24025 -46.8% 1.88x
PrefixAnySeqCntRangeLazy 44679 23813 -46.7% 1.88x
DropWhileAnySeqCntRange 64952 34752 -46.5% 1.87x
PrefixAnySeqCRangeIter 45632 24460 -46.4% 1.87x
LazilyFilteredRange 1467990 788570 -46.3% 1.86x
PrefixWhileAnySeqCntRange 44580 23951 -46.3% 1.86x
DropWhileAnyCollectionLazy 61929 33444 -46.0% 1.85x
DropWhileCountableRangeLazy 61650 33398 -45.8% 1.85x
DropWhileAnySeqCntRangeLazy 62089 33783 -45.6% 1.84x
DropWhileAnySeqCRangeIterLazy 61614 33927 -44.9% 1.82x
PrefixWhileCountableRangeLazy 47435 26183 -44.8% 1.81x
PrefixWhileAnyCollectionLazy 47641 26325 -44.7% 1.81x
PrefixWhileAnySeqCRangeIterLazy 47862 26494 -44.6% 1.81x
PrefixWhileAnySeqCntRangeLazy 47664 26405 -44.6% 1.81x
DropWhileAnySeqCRangeIter 64013 35514 -44.5% 1.80x
PrefixAnySeqCntRange 45090 25747 -42.9% 1.75x
DictionaryGroup 8023 4602 -42.6% 1.74x
ReversedBidirectional 100241 65540 -34.6% 1.53x
SuffixCountableRangeLazy 23812 16259 -31.7% 1.46x
DropLastCountableRangeLazy 23748 16225 -31.7% 1.46x
PrefixCountableRangeLazy 70191 48665 -30.7% 1.44x
DropFirstCountableRangeLazy 70223 49836 -29.0% 1.41x
RemoveWhereQuadraticInts 12019 8605 -28.4% 1.40x
RemoveWhereQuadraticStrings 13634 10217 -25.1% 1.33x
AngryPhonebook.ASCII2 171 141 -17.5% 1.21x
DropFirstAnyCollectionLazy 143714 118559 -17.5% 1.21x (?)
DropLastAnyCollectionLazy 48226 41266 -14.4% 1.17x (?)
PrefixAnyCollectionLazy 142723 122362 -14.3% 1.17x (?)
SuffixAnyCollectionLazy 47427 41123 -13.3% 1.15x (?)
ArrayInitFromSlice 481 429 -10.8% 1.12x (?)
NibbleSort 626290 561680 -10.3% 1.12x
SortArrayInClass 42139 38155 -9.5% 1.10x
PopFrontArrayGeneric 4980 4520 -9.2% 1.10x (?)
ArrayPlusEqualFiveElementCollection 132534 123580 -6.8% 1.07x (?)
FilterEvenUsingReduce 4300 4010 -6.7% 1.07x (?)

Code size: -swiftlibs

Improvement OLD NEW DELTA RATIO
libswiftSwiftOnoneSupport.dylib 163840 131072 -20.0% 1.25x
libswiftCore.dylib 4079616 4014080 -1.6% 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: 8-Core Intel Xeon E5
  Processor Speed: 3 GHz
  Number of Processors: 1
  Total Number of Cores: 8
  L2 Cache (per Core): 256 KB
  L3 Cache: 25 MB
  Memory: 64 GB

@lorentey
Copy link
Member Author

Every symptom here can be explained by one of these three cases:

  1. Client code calls into libswiftCore.dylib where _debugPrecondition works the same as _precondition. (This covers all the 2x cases — they are all AnySequence/AnyCollection tests with a Range base, and Range has a _debugPrecondition in its subscript implementation.)

  2. Removing a precondition check for, say, foo >= 0, prevents the compiler from applying optimizations that assume foo isn’t negative. (This probably covers the utf8_decoding_fastpath.swift test failures as well as the ObjectiveCBridge* performance regressions -- although the latter is more likely to be due to (1).)

  3. Benchmark flakiness. (FlattenListLoop, FlattenListFlatMap, InsertCharacterEndIndex)

@lorentey lorentey closed this Dec 15, 2020
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