Skip to content

[stdlib] Simplify internal DropFirst/PrefixSequence types #19970

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

Conversation

airspeedswift
Copy link
Member

@airspeedswift airspeedswift commented Oct 21, 2018

Because they are internal, but called from inlinable code, this has ABI but not API impact.

@airspeedswift
Copy link
Member Author

@swift-ci please benchmark

@airspeedswift
Copy link
Member Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build comment file:

Performance: -O

TEST OLD NEW DELTA RATIO
Improvement
DropFirstAnySeqCRangeIter 92 57 -38.0% 1.61x
DropFirstAnySeqCRangeIterLazy 92 58 -37.0% 1.59x
DropFirstSequenceLazy 2766 2310 -16.5% 1.20x
DropFirstSequence 2675 2328 -13.0% 1.15x (?)
Array2D 7504 6907 -8.0% 1.09x
MapReduceAnyCollection 398 369 -7.3% 1.08x (?)
MapReduce 427 397 -7.0% 1.08x

Code size: -O

TEST OLD NEW DELTA RATIO
Improvement
DropFirst.o 25500 25212 -1.1% 1.01x

Performance: -Osize

TEST OLD NEW DELTA RATIO
Regression
FloatingPointPrinting_Float_description_uniform 5167 5643 +9.2% 0.92x
Improvement
DropFirstAnySequenceLazy 6170 4719 -23.5% 1.31x
DropFirstAnySequence 6007 4738 -21.1% 1.27x
DropFirstSequenceLazy 3002 2792 -7.0% 1.08x

Code size: -Osize

TEST OLD NEW DELTA RATIO
Improvement
DropFirst.o 24692 23796 -3.6% 1.04x

Performance: -Onone

TEST OLD NEW DELTA RATIO
Improvement
DropFirstSequence 11632 10263 -11.8% 1.13x
DropFirstSequenceLazy 11617 10289 -11.4% 1.13x
DropFirstAnySequenceLazy 12053 10775 -10.6% 1.12x
DropFirstAnySequence 12085 11016 -8.8% 1.10x
DropFirstAnySeqCRangeIterLazy 23223 21240 -8.5% 1.09x
DropFirstAnySeqCRangeIter 22877 21250 -7.1% 1.08x
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

@airspeedswift
Copy link
Member Author

@swift-ci please test

@airspeedswift airspeedswift changed the title [stdlib] Simplify internal DropFirstSequence type [stdlib] Simplify internal DropFirst/PrefixSequence types Oct 21, 2018
@swift-ci

This comment has been minimized.

@swift-ci

This comment has been minimized.

@airspeedswift
Copy link
Member Author

@swift-ci please benchmark

@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
CStringLongAscii 3278 3528 +7.6% 0.93x
Improvement
DropFirstAnySeqCRangeIterLazy 92 57 -38.0% 1.61x
DropFirstAnySeqCRangeIter 92 57 -38.0% 1.61x
DropFirstSequenceLazy 3527 2310 -34.5% 1.53x
DropFirstSequence 2675 2249 -15.9% 1.19x
IterateData 1784 1619 -9.2% 1.10x (?)
Array2D 7505 6908 -8.0% 1.09x
MapReduce 425 396 -6.8% 1.07x

Code size: -O

TEST OLD NEW DELTA RATIO
Improvement
DropFirst.o 25500 25212 -1.1% 1.01x
Prefix.o 24929 24657 -1.1% 1.01x

Performance: -Osize

TEST OLD NEW DELTA RATIO
Improvement
DropFirstAnySequence 6010 4676 -22.2% 1.29x
DropFirstAnySequenceLazy 6009 4676 -22.2% 1.29x
PrefixAnySequence 5128 4129 -19.5% 1.24x
PrefixAnySequenceLazy 5134 4181 -18.6% 1.23x
IterateData 1805 1581 -12.4% 1.14x
DropFirstSequence 2956 2646 -10.5% 1.12x
Array2D 7208 6612 -8.3% 1.09x
DropFirstAnySeqCRangeIter 22391 20810 -7.1% 1.08x
PrefixAnySeqCRangeIterLazy 17669 16461 -6.8% 1.07x
MapReduceAnyCollection 437 408 -6.6% 1.07x

Code size: -Osize

TEST OLD NEW DELTA RATIO
Improvement
DropFirst.o 24692 23796 -3.6% 1.04x
Prefix.o 24425 23761 -2.7% 1.03x

Performance: -Onone

TEST OLD NEW DELTA RATIO
Regression
CStringLongAscii 3373 3644 +8.0% 0.93x
Improvement
PrefixAnySequence 9828 8534 -13.2% 1.15x
DropFirstSequenceLazy 11682 10181 -12.8% 1.15x
PrefixAnySequenceLazy 9812 8554 -12.8% 1.15x
DropFirstSequence 11614 10136 -12.7% 1.15x
PrefixSequence 9336 8238 -11.8% 1.13x
PrefixSequenceLazy 9371 8288 -11.6% 1.13x
DropFirstAnySequenceLazy 12145 10801 -11.1% 1.12x
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 comment file:

Summary for master full

Unexpected test results, excluded stats for RxSwift, Wordy, GRDB, ReactiveSwift

No regressions above thresholds

Debug-batch

debug-batch brief

Regressed (0)
name old new delta delta_pct
Improved (0)
name old new delta delta_pct
Unchanged (delta < 1.0% or delta < 100.0ms) (3)
name old new delta delta_pct
Frontend.NumInstructionsExecuted 14,833,124,190,993 14,838,839,032,464 5,714,841,471 0.04%
LLVM.NumLLVMBytesOutput 668,255,852 668,255,872 20 0.0%
time.swift-driver.wall 1694.9s 1693.4s -1.6s -0.09%

debug-batch detailed

Regressed (0)
name old new delta delta_pct
Improved (0)
name old new delta delta_pct
Unchanged (delta < 1.0% or delta < 100.0ms) (95)
name old new delta delta_pct
AST.NumASTBytesAllocated 19,509,830,273 19,509,834,357 4,084 0.0%
AST.NumDecls 46,718 46,718 0 0.0%
AST.NumDependencies 131,315 131,317 2 0.0%
AST.NumImportedExternalDefinitions 889,050 889,050 0 0.0%
AST.NumInfixOperators 19,678 19,678 0 0.0%
AST.NumLinkLibraries 0 0 0 0.0%
AST.NumLoadedModules 155,098 155,098 0 0.0%
AST.NumLocalTypeDecls 79 79 0 0.0%
AST.NumObjCMethods 12,193 12,193 0 0.0%
AST.NumPostfixOperators 14 14 0 0.0%
AST.NumPrecedenceGroups 9,126 9,126 0 0.0%
AST.NumPrefixOperators 61 61 0 0.0%
AST.NumReferencedDynamicNames 45 45 0 0.0%
AST.NumReferencedMemberNames 2,531,375 2,531,375 0 0.0%
AST.NumReferencedTopLevelNames 153,626 153,626 0 0.0%
AST.NumSourceBuffers 201,636 201,618 -18 -0.01%
AST.NumSourceLines 1,559,934 1,559,934 0 0.0%
AST.NumSourceLinesPerSecond 965,471 964,205 -1,266 -0.13%
AST.NumTotalClangImportedEntities 3,064,155 3,064,155 0 0.0%
AST.NumUsedConformances 144,933 144,933 0 0.0%
Driver.ChildrenMaxRSS 51,622,268,928 51,601,922,048 -20,346,880 -0.04%
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 9,746 9,746 0 0.0%
Driver.NumDriverJobsSkipped 0 0 0 0.0%
Driver.NumDriverPipePolls 206,030 206,609 579 0.28%
Driver.NumDriverPipeReads 226,989 226,656 -333 -0.15%
Driver.NumProcessFailures 0 0 0 0.0%
Frontend.MaxMallocUsage 247,759,364,824 248,053,405,936 294,041,112 0.12%
Frontend.NumInstructionsExecuted 14,833,124,190,993 14,838,839,032,464 5,714,841,471 0.04%
Frontend.NumProcessFailures 0 0 0 0.0%
IRModule.NumIRAliases 75,202 75,202 0 0.0%
IRModule.NumIRBasicBlocks 2,422,992 2,422,992 0 0.0%
IRModule.NumIRComdatSymbols 0 0 0 0.0%
IRModule.NumIRFunctions 1,255,419 1,255,419 0 0.0%
IRModule.NumIRGlobals 1,437,787 1,437,787 0 0.0%
IRModule.NumIRIFuncs 0 0 0 0.0%
IRModule.NumIRInsts 27,641,124 27,641,124 0 0.0%
IRModule.NumIRNamedMetaData 47,511 47,511 0 0.0%
IRModule.NumIRValueSymbols 2,401,250 2,401,250 0 0.0%
LLVM.NumLLVMBytesOutput 668,255,852 668,255,872 20 0.0%
Parse.NumFunctionsParsed 1,510,415 1,510,415 0 0.0%
Parse.NumIterableDeclContextParsed 532,942 532,942 0 0.0%
SILModule.NumSILGenDefaultWitnessTables 0 0 0 0.0%
SILModule.NumSILGenFunctions 1,084,062 1,084,062 0 0.0%
SILModule.NumSILGenGlobalVariables 24,362 24,362 0 0.0%
SILModule.NumSILGenVtables 4,603 4,603 0 0.0%
SILModule.NumSILGenWitnessTables 27,781 27,781 0 0.0%
SILModule.NumSILOptDefaultWitnessTables 0 0 0 0.0%
SILModule.NumSILOptFunctions 923,975 923,975 0 0.0%
SILModule.NumSILOptGlobalVariables 24,830 24,830 0 0.0%
SILModule.NumSILOptVtables 8,811 8,811 0 0.0%
SILModule.NumSILOptWitnessTables 56,081 56,081 0 0.0%
Sema.AccessLevelRequest 1,318,469 1,318,469 0 0.0%
Sema.DefaultAndMaxAccessLevelRequest 31,170 31,170 0 0.0%
Sema.EnumRawTypeRequest 10,453 10,453 0 0.0%
Sema.ExtendedNominalRequest 1,906,337 1,906,343 6 0.0%
Sema.InheritedDeclsReferencedRequest 63,175,232 63,175,220 -12 -0.0%
Sema.InheritedTypeRequest 355,249 355,249 0 0.0%
Sema.IsDynamicRequest 1,196,090 1,196,090 0 0.0%
Sema.IsObjCRequest 1,001,873 1,001,873 0 0.0%
Sema.NamedLazyMemberLoadFailureCount 17,074 17,074 0 0.0%
Sema.NamedLazyMemberLoadSuccessCount 14,145,573 14,145,573 0 0.0%
Sema.NominalTypeLookupDirectCount 22,322,223 22,322,211 -12 -0.0%
Sema.NumConformancesDeserialized 1,963,061 1,963,049 -12 -0.0%
Sema.NumConstraintScopes 12,448,373 12,448,373 0 0.0%
Sema.NumConstraintsConsideredForEdgeContraction 19,305,968 19,305,968 0 0.0%
Sema.NumDeclsDeserialized 18,761,854 18,761,779 -75 -0.0%
Sema.NumDeclsValidated 1,214,718 1,214,718 0 0.0%
Sema.NumFunctionsTypechecked 779,158 779,158 0 0.0%
Sema.NumGenericSignatureBuilders 651,510 651,510 0 0.0%
Sema.NumLazyGenericEnvironments 4,074,740 4,074,689 -51 -0.0%
Sema.NumLazyGenericEnvironmentsLoaded 95,185 95,185 0 0.0%
Sema.NumLazyIterableDeclContexts 3,848,258 3,848,267 9 0.0%
Sema.NumLeafScopes 9,297,666 9,297,666 0 0.0%
Sema.NumTypesDeserialized 7,828,384 7,828,366 -18 -0.0%
Sema.NumTypesValidated 797,112 797,112 0 0.0%
Sema.NumUnloadedLazyIterableDeclContexts 3,106,618 3,106,627 9 0.0%
Sema.OverriddenDeclsRequest 1,055,334 1,055,334 0 0.0%
Sema.RequirementRequest 23,189 23,189 0 0.0%
Sema.SelfBoundsFromWhereClauseRequest 35,116,242 35,116,242 0 0.0%
Sema.SetterAccessLevelRequest 78,600 78,600 0 0.0%
Sema.SuperclassDeclRequest 52,392,978 52,392,978 0 0.0%
Sema.SuperclassTypeRequest 17,684 17,684 0 0.0%
Sema.TypeDeclsFromWhereClauseRequest 14,502 14,502 0 0.0%
Sema.USRGenerationRequest 236,812 236,812 0 0.0%
Sema.UnderlyingTypeDeclsReferencedRequest 1,800,932 1,800,932 0 0.0%

Release

release brief

Regressed (0)
name old new delta delta_pct
Improved (0)
name old new delta delta_pct
Unchanged (delta < 1.0% or delta < 100.0ms) (3)
name old new delta delta_pct
Frontend.NumInstructionsExecuted 18,260,583,445,820 18,263,497,767,309 2,914,321,489 0.02%
LLVM.NumLLVMBytesOutput 568,420,660 568,395,712 -24,948 -0.0%
time.swift-driver.wall 3529.3s 3530.2s 934.4ms 0.03%

release detailed

Regressed (0)
name old new delta delta_pct
Improved (0)
name old new delta delta_pct
Unchanged (delta < 1.0% or delta < 100.0ms) (23)
name old new delta delta_pct
AST.NumImportedExternalDefinitions 170,450 170,450 0 0.0%
AST.NumLoadedModules 10,445 10,445 0 0.0%
AST.NumTotalClangImportedEntities 568,587 568,587 0 0.0%
AST.NumUsedConformances 148,951 148,951 0 0.0%
IRModule.NumIRBasicBlocks 2,397,246 2,396,866 -380 -0.02%
IRModule.NumIRFunctions 1,017,193 1,017,151 -42 -0.0%
IRModule.NumIRGlobals 1,124,092 1,124,044 -48 -0.0%
IRModule.NumIRInsts 20,064,334 20,062,303 -2,031 -0.01%
IRModule.NumIRValueSymbols 1,978,073 1,977,983 -90 -0.0%
LLVM.NumLLVMBytesOutput 568,420,660 568,395,712 -24,948 -0.0%
SILModule.NumSILGenFunctions 444,983 444,983 0 0.0%
SILModule.NumSILOptFunctions 636,444 636,416 -28 -0.0%
Sema.NumConformancesDeserialized 1,286,026 1,284,287 -1,739 -0.14%
Sema.NumConstraintScopes 11,153,262 11,153,262 0 0.0%
Sema.NumDeclsDeserialized 3,882,207 3,876,923 -5,284 -0.14%
Sema.NumDeclsValidated 577,808 577,808 0 0.0%
Sema.NumFunctionsTypechecked 346,914 346,914 0 0.0%
Sema.NumGenericSignatureBuilders 125,219 125,219 0 0.0%
Sema.NumLazyGenericEnvironments 819,167 815,741 -3,426 -0.42%
Sema.NumLazyGenericEnvironmentsLoaded 15,966 15,927 -39 -0.24%
Sema.NumLazyIterableDeclContexts 504,851 505,220 369 0.07%
Sema.NumTypesDeserialized 2,185,606 2,184,574 -1,032 -0.05%
Sema.NumTypesValidated 263,103 263,103 0 0.0%

@airspeedswift airspeedswift merged commit f625f46 into swiftlang:master Oct 22, 2018
rockbruno pushed a commit to rockbruno/swift that referenced this pull request Oct 24, 2018
…19970)

* Simplify internal DropFirstSequence type

* Simplify internal PrefixSequence type
davidungar pushed a commit to davidungar/swift that referenced this pull request Oct 26, 2018
…19970)

* Simplify internal DropFirstSequence type

* Simplify internal PrefixSequence type
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