Skip to content

Request Evaluator: save malloc traffic by canonicalizing AnyRequests #20999

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 1 commit into from
Dec 4, 2018

Conversation

jrose-apple
Copy link
Contributor

Use the Dependencies map to standardize on a single allocation for any particular Request. We could probably go all the way to unique ownership here, but I didn't want to rock the boat.

Results in minor speedups compiling the stdlib. (I was experimenting with using a new, auto-cached Request for a hot lookup path, which may or may not turn out to be worth it, but even without that we can take this.)

Use the Dependencies map to standardize on a single allocation for
any particular Request. We could probably go all the way to unique
ownership here, but I didn't want to rock the boat.

Results in minor speedups compiling the stdlib. (I was experimenting
with using a new, auto-cached Request for a hot lookup path, which may
or may not turn out to be worth it, but even without that we can take
this.)
@jrose-apple
Copy link
Contributor Author

@swift-ci Please test

@jrose-apple
Copy link
Contributor Author

@swift-ci Please test compiler performance

Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great idea, thanks!

@swift-ci
Copy link
Contributor

swift-ci commented Dec 4, 2018

Build comment file:

Summary for master full

Unexpected test results, excluded stats for NonEmpty, Tagged, Wordy, GRDB

Regressions found (see below)

Debug-batch

debug-batch brief

Regressed (1)
name old new delta delta_pct
Frontend.NumInstructionsExecuted 27,707,144,329,439 283,459,661,935,702 255,752,517,606,263 923.06% ⛔
Improved (0)
name old new delta delta_pct
Unchanged (delta < 1.0% or delta < 100.0ms) (2)
name old new delta delta_pct
LLVM.NumLLVMBytesOutput 857,389,086 857,389,184 98 0.0%
time.swift-driver.wall 2653.7s 2635.8s -17.9s -0.67%

debug-batch detailed

Regressed (2)
name old new delta delta_pct
AST.NumSourceLinesPerSecond 766,422 774,151 7,729 1.01% ⛔
Frontend.NumInstructionsExecuted 27,707,144,329,439 283,459,661,935,702 255,752,517,606,263 923.06% ⛔
Improved (4)
name old new delta delta_pct
Driver.NumDriverPipePolls 313,588 309,350 -4,238 -1.35% ✅
Driver.NumDriverPipeReads 352,374 347,722 -4,652 -1.32% ✅
Sema.OverriddenDeclsRequest 3,618,136 3,577,015 -41,121 -1.14% ✅
Sema.USRGenerationRequest 5,217,596 5,095,800 -121,796 -2.33% ✅
Unchanged (delta < 1.0% or delta < 100.0ms) (89)
name old new delta delta_pct
AST.NumASTBytesAllocated 41,508,282,161 41,569,888,160 61,605,999 0.15%
AST.NumDecls 61,350 61,350 0 0.0%
AST.NumDependencies 147,613 147,613 0 0.0%
AST.NumImportedExternalDefinitions 916,940 916,940 0 0.0%
AST.NumInfixOperators 22,247 22,247 0 0.0%
AST.NumLinkLibraries 0 0 0 0.0%
AST.NumLoadedModules 174,735 174,735 0 0.0%
AST.NumLocalTypeDecls 112 112 0 0.0%
AST.NumObjCMethods 12,563 12,563 0 0.0%
AST.NumPostfixOperators 13 13 0 0.0%
AST.NumPrecedenceGroups 12,067 12,067 0 0.0%
AST.NumPrefixOperators 70 70 0 0.0%
AST.NumReferencedDynamicNames 101 101 0 0.0%
AST.NumReferencedMemberNames 2,788,958 2,788,958 0 0.0%
AST.NumReferencedTopLevelNames 196,593 196,593 0 0.0%
AST.NumSourceBuffers 273,817 273,817 0 0.0%
AST.NumSourceLines 2,034,930 2,034,930 0 0.0%
AST.NumTotalClangImportedEntities 3,363,974 3,348,510 -15,464 -0.46%
AST.NumUsedConformances 168,343 168,343 0 0.0%
Driver.ChildrenMaxRSS 66,752,167,936 66,385,762,304 -366,405,632 -0.55%
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,834 12,834 0 0.0%
Driver.NumDriverJobsSkipped 0 0 0 0.0%
Driver.NumProcessFailures 0 0 0 0.0%
Frontend.MaxMallocUsage 347,428,997,728 344,146,482,216 -3,282,515,512 -0.94%
Frontend.NumProcessFailures 0 0 0 0.0%
IRModule.NumIRAliases 89,653 89,653 0 0.0%
IRModule.NumIRBasicBlocks 3,167,329 3,167,329 0 0.0%
IRModule.NumIRComdatSymbols 0 0 0 0.0%
IRModule.NumIRFunctions 1,527,920 1,527,920 0 0.0%
IRModule.NumIRGlobals 1,750,746 1,750,746 0 0.0%
IRModule.NumIRIFuncs 0 0 0 0.0%
IRModule.NumIRInsts 40,246,432 40,246,432 0 0.0%
IRModule.NumIRNamedMetaData 62,817 62,817 0 0.0%
IRModule.NumIRValueSymbols 2,930,647 2,930,647 0 0.0%
LLVM.NumLLVMBytesOutput 857,389,086 857,389,184 98 0.0%
Parse.NumFunctionsParsed 2,106,849 2,106,849 0 0.0%
Parse.NumIterableDeclContextParsed 837,746 837,746 0 0.0%
SILModule.NumSILGenDefaultWitnessTables 0 0 0 0.0%
SILModule.NumSILGenFunctions 1,232,156 1,232,156 0 0.0%
SILModule.NumSILGenGlobalVariables 23,603 23,603 0 0.0%
SILModule.NumSILGenVtables 10,134 10,134 0 0.0%
SILModule.NumSILGenWitnessTables 33,710 33,710 0 0.0%
SILModule.NumSILOptDefaultWitnessTables 0 0 0 0.0%
SILModule.NumSILOptFunctions 1,101,366 1,101,366 0 0.0%
SILModule.NumSILOptGlobalVariables 24,285 24,285 0 0.0%
SILModule.NumSILOptVtables 16,285 16,285 0 0.0%
SILModule.NumSILOptWitnessTables 66,038 66,038 0 0.0%
Sema.AccessLevelRequest 1,806,187 1,806,092 -95 -0.01%
Sema.DefaultAndMaxAccessLevelRequest 43,420 43,420 0 0.0%
Sema.EnumRawTypeRequest 12,383 12,383 0 0.0%
Sema.ExtendedNominalRequest 2,628,732 2,622,726 -6,006 -0.23%
Sema.InheritedDeclsReferencedRequest 80,669,218 80,529,835 -139,383 -0.17%
Sema.InheritedTypeRequest 436,710 436,574 -136 -0.03%
Sema.IsDynamicRequest 1,442,181 1,442,181 0 0.0%
Sema.IsObjCRequest 1,245,306 1,245,676 370 0.03%
Sema.NamedLazyMemberLoadFailureCount 17,483 17,359 -124 -0.71%
Sema.NamedLazyMemberLoadSuccessCount 12,115,397 12,107,889 -7,508 -0.06%
Sema.NominalTypeLookupDirectCount 23,312,968 23,276,514 -36,454 -0.16%
Sema.NumConformancesDeserialized 3,605,161 3,585,977 -19,184 -0.53%
Sema.NumConstraintScopes 10,965,533 10,964,275 -1,258 -0.01%
Sema.NumConstraintsConsideredForEdgeContraction 20,356,073 20,355,288 -785 -0.0%
Sema.NumDeclsDeserialized 29,474,262 29,251,619 -222,643 -0.76%
Sema.NumDeclsValidated 1,541,160 1,541,160 0 0.0%
Sema.NumFunctionsTypechecked 878,617 878,617 0 0.0%
Sema.NumGenericSignatureBuilders 837,349 835,669 -1,680 -0.2%
Sema.NumLazyGenericEnvironments 6,036,641 6,039,416 2,775 0.05%
Sema.NumLazyGenericEnvironmentsLoaded 162,978 162,970 -8 -0.0%
Sema.NumLazyIterableDeclContexts 4,803,387 4,791,996 -11,391 -0.24%
Sema.NumLeafScopes 7,723,774 7,722,818 -956 -0.01%
Sema.NumTypesDeserialized 10,734,066 10,709,587 -24,479 -0.23%
Sema.NumTypesValidated 1,029,997 1,029,995 -2 -0.0%
Sema.NumUnloadedLazyIterableDeclContexts 3,374,609 3,369,785 -4,824 -0.14%
Sema.RequirementRequest 54,264 54,264 0 0.0%
Sema.SelfBoundsFromWhereClauseRequest 47,080,566 47,040,899 -39,667 -0.08%
Sema.SetterAccessLevelRequest 98,828 98,828 0 0.0%
Sema.SuperclassDeclRequest 63,483,521 63,384,975 -98,546 -0.16%
Sema.SuperclassTypeRequest 30,156 30,156 0 0.0%
Sema.TypeDeclsFromWhereClauseRequest 25,755 25,755 0 0.0%
Sema.UnderlyingTypeDeclsReferencedRequest 2,329,917 2,328,673 -1,244 -0.05%

Release

release brief

Regressed (1)
name old new delta delta_pct
Frontend.NumInstructionsExecuted 21,848,033,107,825 83,137,494,163,912 61,289,461,056,087 280.53% ⛔
Improved (1)
name old new delta delta_pct
time.swift-driver.wall 4116.7s 4063.6s -53.0s -1.29% ✅
Unchanged (delta < 1.0% or delta < 100.0ms) (1)
name old new delta delta_pct
LLVM.NumLLVMBytesOutput 787,527,270 787,528,678 1,408 0.0%

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,085 170,085 0 0.0%
AST.NumLoadedModules 10,893 10,893 0 0.0%
AST.NumTotalClangImportedEntities 580,399 580,399 0 0.0%
AST.NumUsedConformances 169,060 169,060 0 0.0%
IRModule.NumIRBasicBlocks 2,741,277 2,741,277 0 0.0%
IRModule.NumIRFunctions 1,266,784 1,266,784 0 0.0%
IRModule.NumIRGlobals 1,394,596 1,394,596 0 0.0%
IRModule.NumIRInsts 26,643,319 26,643,319 0 0.0%
IRModule.NumIRValueSymbols 2,492,308 2,492,308 0 0.0%
LLVM.NumLLVMBytesOutput 787,527,270 787,528,678 1,408 0.0%
SILModule.NumSILGenFunctions 536,355 536,355 0 0.0%
SILModule.NumSILOptFunctions 658,062 658,062 0 0.0%
Sema.NumConformancesDeserialized 1,498,834 1,498,834 0 0.0%
Sema.NumConstraintScopes 9,664,494 9,664,494 0 0.0%
Sema.NumDeclsDeserialized 3,959,424 3,959,424 0 0.0%
Sema.NumDeclsValidated 812,330 812,330 0 0.0%
Sema.NumFunctionsTypechecked 433,384 433,384 0 0.0%
Sema.NumGenericSignatureBuilders 140,301 140,301 0 0.0%
Sema.NumLazyGenericEnvironments 823,816 823,816 0 0.0%
Sema.NumLazyGenericEnvironmentsLoaded 15,102 15,102 0 0.0%
Sema.NumLazyIterableDeclContexts 524,517 524,517 0 0.0%
Sema.NumTypesDeserialized 2,091,652 2,091,652 0 0.0%
Sema.NumTypesValidated 389,930 389,930 0 0.0%

@jrose-apple jrose-apple merged commit bcc4ba9 into swiftlang:master Dec 4, 2018
@jrose-apple jrose-apple deleted the yes-this-is-canon branch December 4, 2018 17:06
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.

3 participants