Skip to content

[stdlib][DNM] Remove Sequence.SubSequence #20175

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

Conversation

airspeedswift
Copy link
Member

Continuation of #19995. Moves SubSequence up to Collection.

@airspeedswift
Copy link
Member Author

@swift-ci please test source compatibility

@airspeedswift
Copy link
Member Author

@swift-ci please benchmark

@airspeedswift
Copy link
Member Author

@swift-ci please test

@airspeedswift
Copy link
Member Author

@swift-ci please test compiler performance

@swift-ci
Copy link
Contributor

Build comment file:

Performance: -O

TEST OLD NEW DELTA RATIO
Regression
DropLastAnySeqCntRangeLazy 9 20366 +226163.8% 0.00x
SuffixAnySeqCntRangeLazy 14 20699 +147739.4% 0.00x
DropLastAnySeqCntRange 9 524 +5721.6% 0.02x
SuffixAnySeqCntRange 14 760 +5328.2% 0.02x
DropLastAnySeqCRangeIterLazy 3325 20415 +514.0% 0.16x
SuffixAnySeqCRangeIterLazy 3608 20787 +476.1% 0.17x
PrefixAnySeqCRangeIterLazy 31 88 +183.9% 0.35x
PrefixAnySeqCRangeIter 31 88 +183.9% 0.35x
DropFirstAnySeqCRangeIter 58 93 +60.3% 0.62x
PrefixAnySequence 1375 2199 +59.9% 0.63x
DropFirstAnySeqCRangeIterLazy 58 91 +56.9% 0.64x
DropFirstAnySequenceLazy 1855 2729 +47.1% 0.68x
DropWhileAnySequence 1855 2694 +45.2% 0.69x
DropFirstAnySequence 1855 2640 +42.3% 0.70x
DropFirstAnySeqCntRange 71 92 +29.6% 0.77x
DropFirstAnySeqCntRangeLazy 71 91 +28.2% 0.78x
DropWhileAnySeqCRangeIter 75 94 +25.3% 0.80x
PrefixAnySeqCntRange 71 88 +23.9% 0.81x
PrefixAnySeqCntRangeLazy 71 88 +23.9% 0.81x
COWArrayGuaranteedParameterOverhead 11056 12182 +10.2% 0.91x
Improvement
DropWhileSequence 2214 29 -98.7% 76.34x
PrefixSequenceLazy 2264 52 -97.7% 43.54x
PrefixSequence 2211 52 -97.6% 42.52x
DropFirstSequenceLazy 2310 59 -97.4% 39.15x
DropFirstSequence 2259 59 -97.4% 38.29x
SuffixAnySequence 4885 540 -88.9% 9.05x
DropLastAnySequence 4919 552 -88.8% 8.91x
DropLastAnySeqCRangeIter 3323 525 -84.2% 6.33x
SuffixSequenceLazy 3664 586 -84.0% 6.25x
SuffixSequence 3664 586 -84.0% 6.25x
SuffixAnySeqCRangeIter 3609 824 -77.2% 4.38x
DropLastAnySequenceLazy 4996 3450 -30.9% 1.45x
SuffixAnySequenceLazy 4993 3597 -28.0% 1.39x
PrefixWhileAnySeqCRangeIter 400 346 -13.5% 1.16x
IterateData 1789 1618 -9.6% 1.11x (?)

Code size: -O

TEST OLD NEW DELTA RATIO
Regression
DropLast.o 25515 26913 +5.5% 0.95x
Suffix.o 26249 27299 +4.0% 0.96x
DropFirst.o 25228 25756 +2.1% 0.98x
Prefix.o 24673 25057 +1.6% 0.98x
Improvement
NibbleSort.o 14348 8402 -41.4% 1.71x
COWTree.o 14564 13572 -6.8% 1.07x
LuhnAlgoLazy.o 18236 17244 -5.4% 1.06x
LuhnAlgoEager.o 18238 17246 -5.4% 1.06x
SequenceAlgos.o 23315 22323 -4.3% 1.04x
DictOfArraysToArrayOfDicts.o 32340 31320 -3.2% 1.03x
Substring.o 27833 27163 -2.4% 1.02x
PrefixWhile.o 24062 23502 -2.3% 1.02x
StringBuilder.o 11679 11455 -1.9% 1.02x

Performance: -Osize

TEST OLD NEW DELTA RATIO
Regression
DropLastAnySeqCRangeIterLazy 3684 20142 +446.7% 0.18x
SuffixAnySeqCRangeIterLazy 3973 20223 +409.0% 0.20x
SuffixAnySeqCntRangeLazy 5225 20235 +287.3% 0.26x
DropLastAnySeqCntRangeLazy 5256 20113 +282.7% 0.26x
DropFirstAnySeqCntRange 15730 20645 +31.2% 0.76x
DropWhileAnyCollectionLazy 252 282 +11.9% 0.89x
SuffixAnyCollection 59 65 +10.2% 0.91x
Improvement
DropWhileAnySeqCRangeIter 17631 163 -99.1% 108.16x
DropFirstAnySeqCRangeIterLazy 21259 213 -99.0% 99.81x
PrefixAnySeqCRangeIterLazy 16679 176 -98.9% 94.77x
PrefixAnySeqCntRangeLazy 15810 168 -98.9% 94.11x
DropFirstAnySeqCntRangeLazy 15717 213 -98.6% 73.79x
DropWhileSequence 2582 35 -98.6% 73.77x
DropFirstSequenceLazy 2671 58 -97.8% 46.05x
DropFirstSequence 2649 58 -97.8% 45.67x
PrefixSequence 2705 70 -97.4% 38.64x
PrefixSequenceLazy 2670 70 -97.4% 38.14x
PrefixWhileAnySeqCRangeIter 9604 346 -96.4% 27.76x
DropLastAnySeqCntRange 5260 537 -89.8% 9.80x
DropLastAnySequence 5585 678 -87.9% 8.24x
SuffixAnySeqCntRange 5262 761 -85.5% 6.91x
DropLastAnySeqCRangeIter 3683 533 -85.5% 6.91x
PrefixWhileAnySequence 11028 1692 -84.7% 6.52x
SuffixAnySequence 5568 943 -83.1% 5.90x
SuffixAnySeqCRangeIter 3971 826 -79.2% 4.81x
SuffixSequence 3990 937 -76.5% 4.26x
SuffixSequenceLazy 3989 938 -76.5% 4.25x
PrefixAnySequenceLazy 4144 1581 -61.8% 2.62x
DropWhileAnySequence 5597 3223 -42.4% 1.74x
DropLastAnySequenceLazy 5653 3679 -34.9% 1.54x
DropFirstAnySequenceLazy 4728 3184 -32.7% 1.48x
SuffixAnySequenceLazy 5609 3873 -31.0% 1.45x
PrefixWhileSequence 490 345 -29.6% 1.42x
DropWhileAnySeqCntRange 206 164 -20.4% 1.26x
PrefixWhileAnyCollectionLazy 176 159 -9.7% 1.11x
DropLastAnyCollection 65 59 -9.2% 1.10x
IterateData 1834 1692 -7.7% 1.08x (?)
PrefixAnySequence 4147 3827 -7.7% 1.08x
DropFirstAnySequence 4719 4371 -7.4% 1.08x (?)

Code size: -Osize

TEST OLD NEW DELTA RATIO
Regression
StringEdits.o 13814 14200 +2.8% 0.97x
DropFirst.o 23812 24356 +2.3% 0.98x
DropLast.o 25539 26017 +1.9% 0.98x
Prefix.o 23777 24161 +1.6% 0.98x
Suffix.o 25937 26251 +1.2% 0.99x
StringRemoveDupes.o 8973 9077 +1.2% 0.99x
Improvement
NibbleSort.o 19652 12746 -35.1% 1.54x
COWTree.o 13682 12690 -7.3% 1.08x
Substring.o 20129 18681 -7.2% 1.08x
PrefixWhile.o 24446 22782 -6.8% 1.07x
LuhnAlgoLazy.o 15900 14908 -6.2% 1.07x
LuhnAlgoEager.o 15902 14910 -6.2% 1.07x
SequenceAlgos.o 26060 25068 -3.8% 1.04x
CSVParsing.o 37096 35880 -3.3% 1.03x
DictOfArraysToArrayOfDicts.o 32452 31432 -3.1% 1.03x
StringBuilder.o 11210 11066 -1.3% 1.01x

Performance: -Onone

TEST OLD NEW DELTA RATIO
Regression
DropLastAnySeqCntRangeLazy 5493 38817 +606.7% 0.14x
DropLastAnySeqCntRange 5510 38248 +594.2% 0.14x
SuffixAnySeqCntRangeLazy 5509 32307 +486.4% 0.17x
SuffixAnySeqCntRange 5486 31989 +483.1% 0.17x
StringMatch 28817 49956 +73.4% 0.58x
StringUTF16SubstringBuilder 21090 31241 +48.1% 0.68x
DropFirstAnySeqCntRange 16467 21615 +31.3% 0.76x
DropFirstAnySeqCntRangeLazy 16568 21566 +30.2% 0.77x
StringBuilderWithLongSubstring 4002 5183 +29.5% 0.77x
StringRemoveDupes 745 959 +28.7% 0.78x
DropWhileAnySeqCntRange 21593 24932 +15.5% 0.87x
ObjectiveCBridgeFromNSSetAnyObjectForced 4786 5444 +13.7% 0.88x
SubstringEqualString 1775 1980 +11.5% 0.90x
PrefixAnySequenceLazy 8669 9665 +11.5% 0.90x
PrefixAnySeqCntRangeLazy 16398 18011 +9.8% 0.91x
StringEdits 396955 430814 +8.5% 0.92x
Improvement
Histogram 6766 5669 -16.2% 1.19x
RGBHistogram 23706 21485 -9.4% 1.10x
DropFirstAnySequence 10976 10203 -7.0% 1.08x

Code size: Swift libraries

TEST OLD NEW DELTA RATIO
Improvement
libswiftsimd.dylib 286720 212992 -25.7% 1.35x
libswiftSwiftReflectionTest.dylib 49152 36864 -25.0% 1.33x
libswiftCoreAudio.dylib 32768 24576 -25.0% 1.33x
libswiftCloudKit.dylib 98304 81920 -16.7% 1.20x
libswiftDispatch.dylib 114688 98304 -14.3% 1.17x
libswiftCore.dylib 3944448 3588096 -9.0% 1.10x
libswiftFoundation.dylib 1728512 1622016 -6.2% 1.07x
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 - f9880eb772bea0d059a3781e770924292286a23e

@swift-ci
Copy link
Contributor

Build comment file:

Summary for master full

Unexpected test results, excluded stats for NonEmpty, GRDB, Wordy, ProcedureKitCloud, ReactiveSwift

Regressions found (see below)

Debug-batch

debug-batch brief

Regressed (0)
name old new delta delta_pct
Improved (1)
name old new delta delta_pct
Frontend.NumInstructionsExecuted 17,307,947,114,844 17,075,237,329,837 -232,709,785,007 -1.34% ✅
Unchanged (delta < 1.0% or delta < 100.0ms) (2)
name old new delta delta_pct
LLVM.NumLLVMBytesOutput 845,640,232 843,252,836 -2,387,396 -0.28%
time.swift-driver.wall 1924.9s 1923.8s -1.1s -0.06%

debug-batch detailed

Regressed (1)
name old new delta delta_pct
AST.NumSourceLinesPerSecond 1,150,452 1,169,808 19,356 1.68% ⛔
Improved (12)
name old new delta delta_pct
Driver.NumDriverPipePolls 305,152 295,382 -9,770 -3.2% ✅
Driver.NumDriverPipeReads 345,116 333,828 -11,288 -3.27% ✅
Frontend.MaxMallocUsage 282,742,168,032 277,889,269,056 -4,852,898,976 -1.72% ✅
Frontend.NumInstructionsExecuted 17,307,947,114,844 17,075,237,329,837 -232,709,785,007 -1.34% ✅
Sema.NamedLazyMemberLoadSuccessCount 15,134,327 14,915,955 -218,372 -1.44% ✅
Sema.NumConformancesDeserialized 2,257,485 2,215,157 -42,328 -1.88% ✅
Sema.NumDeclsDeserialized 21,665,369 21,237,860 -427,509 -1.97% ✅
Sema.NumGenericSignatureBuilders 744,147 722,318 -21,829 -2.93% ✅
Sema.NumLazyGenericEnvironments 4,767,129 4,574,368 -192,761 -4.04% ✅
Sema.NumLazyIterableDeclContexts 4,316,349 4,262,029 -54,320 -1.26% ✅
Sema.NumTypesDeserialized 9,070,266 8,850,549 -219,717 -2.42% ✅
Sema.NumUnloadedLazyIterableDeclContexts 3,464,728 3,413,193 -51,535 -1.49% ✅
Unchanged (delta < 1.0% or delta < 100.0ms) (82)
name old new delta delta_pct
AST.NumASTBytesAllocated 22,993,766,034 22,806,151,902 -187,614,132 -0.82%
AST.NumDecls 61,300 61,300 0 0.0%
AST.NumDependencies 141,586 141,578 -8 -0.01%
AST.NumImportedExternalDefinitions 919,296 919,296 0 0.0%
AST.NumInfixOperators 23,732 23,732 0 0.0%
AST.NumLinkLibraries 0 0 0 0.0%
AST.NumLoadedModules 169,235 169,235 0 0.0%
AST.NumLocalTypeDecls 81 81 0 0.0%
AST.NumObjCMethods 12,337 12,337 0 0.0%
AST.NumPostfixOperators 13 13 0 0.0%
AST.NumPrecedenceGroups 12,171 12,171 0 0.0%
AST.NumPrefixOperators 57 57 0 0.0%
AST.NumReferencedDynamicNames 46 46 0 0.0%
AST.NumReferencedMemberNames 2,992,179 2,980,679 -11,500 -0.38%
AST.NumReferencedTopLevelNames 200,455 200,457 2 0.0%
AST.NumSourceBuffers 276,775 276,775 0 0.0%
AST.NumSourceLines 1,954,736 1,954,736 0 0.0%
AST.NumTotalClangImportedEntities 3,209,955 3,209,955 0 0.0%
AST.NumUsedConformances 179,624 179,213 -411 -0.23%
Driver.ChildrenMaxRSS 56,194,826,240 56,037,822,464 -157,003,776 -0.28%
Driver.DriverDepCascadingDynamic 0 0 0 0.0%
Driver.DriverDepCascadingExternal 0 0 0 0.0%
Driver.DriverDepCascadingMember 0 0 0 0.0%
Driver.DriverDepCascadingNominal 0 0 0 0.0%
Driver.DriverDepCascadingTopLevel 0 0 0 0.0%
Driver.DriverDepDynamic 0 0 0 0.0%
Driver.DriverDepExternal 0 0 0 0.0%
Driver.DriverDepMember 0 0 0 0.0%
Driver.DriverDepNominal 0 0 0 0.0%
Driver.DriverDepTopLevel 0 0 0 0.0%
Driver.NumDriverJobsRun 12,986 12,986 0 0.0%
Driver.NumDriverJobsSkipped 0 0 0 0.0%
Driver.NumProcessFailures 0 0 0 0.0%
Frontend.NumProcessFailures 0 0 0 0.0%
IRModule.NumIRAliases 90,278 90,278 0 0.0%
IRModule.NumIRBasicBlocks 3,424,691 3,416,975 -7,716 -0.23%
IRModule.NumIRComdatSymbols 0 0 0 0.0%
IRModule.NumIRFunctions 1,536,167 1,529,666 -6,501 -0.42%
IRModule.NumIRGlobals 1,754,050 1,746,792 -7,258 -0.41%
IRModule.NumIRIFuncs 0 0 0 0.0%
IRModule.NumIRInsts 35,599,381 35,561,453 -37,928 -0.11%
IRModule.NumIRNamedMetaData 63,546 63,546 0 0.0%
IRModule.NumIRValueSymbols 2,938,536 2,924,937 -13,599 -0.46%
LLVM.NumLLVMBytesOutput 845,640,232 843,252,836 -2,387,396 -0.28%
Parse.NumFunctionsParsed 1,980,856 1,980,856 0 0.0%
Parse.NumIterableDeclContextParsed 789,745 789,745 0 0.0%
SILModule.NumSILGenDefaultWitnessTables 0 0 0 0.0%
SILModule.NumSILGenFunctions 1,237,280 1,231,307 -5,973 -0.48%
SILModule.NumSILGenGlobalVariables 25,978 25,978 0 0.0%
SILModule.NumSILGenVtables 9,632 9,632 0 0.0%
SILModule.NumSILGenWitnessTables 35,980 35,980 0 0.0%
SILModule.NumSILOptDefaultWitnessTables 0 0 0 0.0%
SILModule.NumSILOptFunctions 1,128,926 1,117,901 -11,025 -0.98%
SILModule.NumSILOptGlobalVariables 26,711 26,711 0 0.0%
SILModule.NumSILOptVtables 15,499 15,493 -6 -0.04%
SILModule.NumSILOptWitnessTables 69,530 69,530 0 0.0%
Sema.AccessLevelRequest 1,697,142 1,697,063 -79 -0.0%
Sema.DefaultAndMaxAccessLevelRequest 41,642 41,642 0 0.0%
Sema.EnumRawTypeRequest 12,650 12,650 0 0.0%
Sema.ExtendedNominalRequest 2,222,880 2,205,256 -17,624 -0.79%
Sema.InheritedDeclsReferencedRequest 74,657,420 74,496,691 -160,729 -0.22%
Sema.InheritedTypeRequest 412,331 412,098 -233 -0.06%
Sema.IsDynamicRequest 1,448,184 1,441,474 -6,710 -0.46%
Sema.IsObjCRequest 1,216,120 1,216,034 -86 -0.01%
Sema.NamedLazyMemberLoadFailureCount 16,909 16,909 0 0.0%
Sema.NominalTypeLookupDirectCount 24,542,581 24,351,805 -190,776 -0.78%
Sema.NumConstraintScopes 14,137,471 14,121,345 -16,126 -0.11%
Sema.NumConstraintsConsideredForEdgeContraction 23,785,982 23,690,790 -95,192 -0.4%
Sema.NumDeclsValidated 1,499,631 1,499,550 -81 -0.01%
Sema.NumFunctionsTypechecked 878,650 878,650 0 0.0%
Sema.NumLazyGenericEnvironmentsLoaded 153,558 152,658 -900 -0.59%
Sema.NumLeafScopes 10,346,320 10,333,914 -12,406 -0.12%
Sema.NumTypesValidated 998,837 998,783 -54 -0.01%
Sema.OverriddenDeclsRequest 1,271,641 1,271,549 -92 -0.01%
Sema.RequirementRequest 40,362 40,362 0 0.0%
Sema.SelfBoundsFromWhereClauseRequest 38,939,103 38,685,532 -253,571 -0.65%
Sema.SetterAccessLevelRequest 95,553 95,548 -5 -0.01%
Sema.SuperclassDeclRequest 62,880,650 62,768,176 -112,474 -0.18%
Sema.SuperclassTypeRequest 28,712 28,712 0 0.0%
Sema.TypeDeclsFromWhereClauseRequest 22,217 22,217 0 0.0%
Sema.USRGenerationRequest 306,377 306,377 0 0.0%
Sema.UnderlyingTypeDeclsReferencedRequest 1,977,717 1,965,617 -12,100 -0.61%

Release

release brief

Regressed (0)
name old new delta delta_pct
Improved (2)
name old new delta delta_pct
Frontend.NumInstructionsExecuted 20,673,286,387,448 20,285,476,712,637 -387,809,674,811 -1.88% ✅
time.swift-driver.wall 4011.0s 3925.4s -85.6s -2.14% ✅
Unchanged (delta < 1.0% or delta < 100.0ms) (1)
name old new delta delta_pct
LLVM.NumLLVMBytesOutput 695,763,888 691,338,184 -4,425,704 -0.64%

release detailed

Regressed (0)
name old new delta delta_pct
Improved (8)
name old new delta delta_pct
IRModule.NumIRBasicBlocks 2,699,316 2,667,850 -31,466 -1.17% ✅
SILModule.NumSILOptFunctions 738,225 691,699 -46,526 -6.3% ✅
Sema.NumConformancesDeserialized 1,385,712 1,291,920 -93,792 -6.77% ✅
Sema.NumDeclsDeserialized 4,138,386 4,035,336 -103,050 -2.49% ✅
Sema.NumGenericSignatureBuilders 147,093 141,210 -5,883 -4.0% ✅
Sema.NumLazyGenericEnvironments 868,240 828,099 -40,141 -4.62% ✅
Sema.NumLazyGenericEnvironmentsLoaded 17,027 16,711 -316 -1.86% ✅
Sema.NumTypesDeserialized 2,326,915 2,162,131 -164,784 -7.08% ✅
Unchanged (delta < 1.0% or delta < 100.0ms) (15)
name old new delta delta_pct
AST.NumImportedExternalDefinitions 177,953 177,953 0 0.0%
AST.NumLoadedModules 11,180 11,180 0 0.0%
AST.NumTotalClangImportedEntities 600,338 600,296 -42 -0.01%
AST.NumUsedConformances 182,900 182,493 -407 -0.22%
IRModule.NumIRFunctions 1,237,749 1,230,612 -7,137 -0.58%
IRModule.NumIRGlobals 1,393,387 1,385,693 -7,694 -0.55%
IRModule.NumIRInsts 23,712,597 23,520,502 -192,095 -0.81%
IRModule.NumIRValueSymbols 2,425,899 2,411,210 -14,689 -0.61%
LLVM.NumLLVMBytesOutput 695,763,888 691,338,184 -4,425,704 -0.64%
SILModule.NumSILGenFunctions 540,635 536,199 -4,436 -0.82%
Sema.NumConstraintScopes 12,734,100 12,728,800 -5,300 -0.04%
Sema.NumDeclsValidated 744,780 744,780 0 0.0%
Sema.NumFunctionsTypechecked 435,391 435,391 0 0.0%
Sema.NumLazyIterableDeclContexts 542,847 538,070 -4,777 -0.88%
Sema.NumTypesValidated 364,161 364,161 0 0.0%

@airspeedswift
Copy link
Member Author

@swift-ci please smoke test

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