Skip to content

[Serialization] Clean up type deserialization in the same way as decl deserialization #22666

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 6 commits into from
Feb 27, 2019

Conversation

jrose-apple
Copy link
Contributor

…by using a helper class. Type equivalent of #22610. Not quite as much of a cleanup as the decl one, but still good, and still possibly going to improve backtraces.

No functionality change. I suggest reviewing commit by commit.

@jrose-apple
Copy link
Contributor Author

@swift-ci Please test

@jrose-apple
Copy link
Contributor Author

@swift-ci Please test compiler performance

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 033169624b3c8fa9dc51e697d233f83f9b7ba1b6

@swift-ci
Copy link
Contributor

Summary for master full

Unexpected test results, excluded stats for ProcedureKit, CoreStore, Wordy, Tagged, Deferred

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 27,171,166,075,362 27,136,468,712,636 -34,697,362,726 -0.13%
LLVM.NumLLVMBytesOutput 986,305,060 986,307,666 2,606 0.0%
time.swift-driver.wall 2613.9s 2612.2s -1.7s -0.06%

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) (99)
name old new delta delta_pct
AST.NumASTBytesAllocated 65,440,074,860 65,238,987,539 -201,087,321 -0.31%
AST.NumDecls 80,370 80,370 0 0.0%
AST.NumDependencies 204,312 204,312 0 0.0%
AST.NumImportedExternalDefinitions 1,084,836 1,084,836 0 0.0%
AST.NumInfixOperators 30,936 30,936 0 0.0%
AST.NumLinkLibraries 0 0 0 0.0%
AST.NumLoadedModules 243,405 243,405 0 0.0%
AST.NumLocalTypeDecls 108 108 0 0.0%
AST.NumObjCMethods 9,687 9,687 0 0.0%
AST.NumPostfixOperators 18 18 0 0.0%
AST.NumPrecedenceGroups 14,464 14,464 0 0.0%
AST.NumPrefixOperators 70 70 0 0.0%
AST.NumReferencedDynamicNames 91 91 0 0.0%
AST.NumReferencedMemberNames 3,491,464 3,491,464 0 0.0%
AST.NumReferencedTopLevelNames 269,721 269,721 0 0.0%
AST.NumSourceBuffers 330,950 330,950 0 0.0%
AST.NumSourceLines 2,418,773 2,418,773 0 0.0%
AST.NumSourceLinesPerSecond 2,107,921 2,120,166 12,245 0.58%
AST.NumTotalClangImportedEntities 4,103,360 4,096,857 -6,503 -0.16%
AST.NumUsedConformances 225,774 225,774 0 0.0%
Driver.ChildrenMaxRSS 106,222,526,464 106,123,659,264 -98,867,200 -0.09%
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 16,141 16,141 0 0.0%
Driver.NumDriverJobsSkipped 0 0 0 0.0%
Driver.NumDriverPipePolls 213,650 211,842 -1,808 -0.85%
Driver.NumDriverPipeReads 234,324 234,291 -33 -0.01%
Driver.NumProcessFailures 0 0 0 0.0%
Frontend.MaxMallocUsage 684,427,007,536 684,067,171,096 -359,836,440 -0.05%
Frontend.NumInstructionsExecuted 27,171,166,075,362 27,136,468,712,636 -34,697,362,726 -0.13%
Frontend.NumProcessFailures 0 0 0 0.0%
IRModule.NumIRAliases 107,112 107,112 0 0.0%
IRModule.NumIRBasicBlocks 3,815,650 3,815,650 0 0.0%
IRModule.NumIRComdatSymbols 0 0 0 0.0%
IRModule.NumIRFunctions 1,785,126 1,785,126 0 0.0%
IRModule.NumIRGlobals 1,843,931 1,843,931 0 0.0%
IRModule.NumIRIFuncs 0 0 0 0.0%
IRModule.NumIRInsts 45,995,785 45,995,785 0 0.0%
IRModule.NumIRNamedMetaData 78,122 78,122 0 0.0%
IRModule.NumIRValueSymbols 3,272,585 3,272,585 0 0.0%
LLVM.NumLLVMBytesOutput 986,305,060 986,307,666 2,606 0.0%
Parse.NumFunctionsParsed 141,840 141,840 0 0.0%
Parse.NumIterableDeclContextParsed 1,000,396 1,000,396 0 0.0%
SILModule.NumSILGenDefaultWitnessTables 0 0 0 0.0%
SILModule.NumSILGenFunctions 925,412 925,412 0 0.0%
SILModule.NumSILGenGlobalVariables 37,118 37,118 0 0.0%
SILModule.NumSILGenVtables 10,668 10,668 0 0.0%
SILModule.NumSILGenWitnessTables 39,057 39,057 0 0.0%
SILModule.NumSILOptDefaultWitnessTables 0 0 0 0.0%
SILModule.NumSILOptFunctions 1,314,264 1,314,264 0 0.0%
SILModule.NumSILOptGlobalVariables 37,865 37,865 0 0.0%
SILModule.NumSILOptVtables 17,156 17,156 0 0.0%
SILModule.NumSILOptWitnessTables 85,971 85,971 0 0.0%
Sema.AccessLevelRequest 2,297,475 2,296,471 -1,004 -0.04%
Sema.DefaultAndMaxAccessLevelRequest 54,260 54,252 -8 -0.01%
Sema.DefaultTypeRequest 314,970 314,970 0 0.0%
Sema.EnumRawTypeRequest 16,934 16,934 0 0.0%
Sema.ExtendedNominalRequest 3,652,234 3,650,210 -2,024 -0.06%
Sema.InheritedDeclsReferencedRequest 4,385,586 4,377,664 -7,922 -0.18%
Sema.InheritedTypeRequest 527,762 527,546 -216 -0.04%
Sema.IsDynamicRequest 1,820,432 1,820,432 0 0.0%
Sema.IsObjCRequest 1,554,539 1,554,238 -301 -0.02%
Sema.MangleLocalTypeDeclRequest 216 216 0 0.0%
Sema.NamedLazyMemberLoadFailureCount 18,825 18,800 -25 -0.13%
Sema.NamedLazyMemberLoadSuccessCount 17,068,966 17,071,860 2,894 0.02%
Sema.NominalTypeLookupDirectCount 28,956,635 28,939,585 -17,050 -0.06%
Sema.NumConformancesDeserialized 6,415,417 6,401,080 -14,337 -0.22%
Sema.NumConstraintScopes 16,876,514 16,874,375 -2,139 -0.01%
Sema.NumConstraintsConsideredForEdgeContraction 54,321,959 54,321,409 -550 -0.0%
Sema.NumDeclsDeserialized 46,922,657 46,825,901 -96,756 -0.21%
Sema.NumDeclsFinalized 1,634,588 1,634,588 0 0.0%
Sema.NumDeclsTypechecked 890,594 890,594 0 0.0%
Sema.NumDeclsValidated 1,933,960 1,933,960 0 0.0%
Sema.NumFunctionsTypechecked 942,828 942,828 0 0.0%
Sema.NumGenericSignatureBuilders 1,128,831 1,127,849 -982 -0.09%
Sema.NumLazyGenericEnvironments 9,368,418 9,360,148 -8,270 -0.09%
Sema.NumLazyGenericEnvironmentsLoaded 195,457 195,397 -60 -0.03%
Sema.NumLazyIterableDeclContexts 6,549,700 6,546,267 -3,433 -0.05%
Sema.NumLeafScopes 10,969,006 10,967,227 -1,779 -0.02%
Sema.NumTypesDeserialized 15,808,151 15,792,899 -15,252 -0.1%
Sema.NumTypesValidated 1,309,555 1,309,555 0 0.0%
Sema.NumUnloadedLazyIterableDeclContexts 4,314,910 4,316,495 1,585 0.04%
Sema.OverriddenDeclsRequest 7,302,953 7,265,705 -37,248 -0.51%
Sema.RequirementRequest 62,070 62,070 0 0.0%
Sema.SelfBoundsFromWhereClauseRequest 6,162,425 6,152,272 -10,153 -0.16%
Sema.SetterAccessLevelRequest 136,606 136,606 0 0.0%
Sema.SuperclassDeclRequest 66,759 66,677 -82 -0.12%
Sema.SuperclassTypeRequest 30,706 30,706 0 0.0%
Sema.TypeDeclsFromWhereClauseRequest 29,812 29,804 -8 -0.03%
Sema.USRGenerationRequest 12,186,960 12,110,727 -76,233 -0.63%
Sema.UnderlyingTypeDeclsReferencedRequest 194,136 193,923 -213 -0.11%

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 25,803,123,258,578 25,798,894,249,365 -4,229,009,213 -0.02%
LLVM.NumLLVMBytesOutput 796,757,694 796,760,410 2,716 0.0%
time.swift-driver.wall 4615.6s 4608.5s -7.1s -0.15%

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 214,765 214,765 0 0.0%
AST.NumLoadedModules 16,334 16,334 0 0.0%
AST.NumTotalClangImportedEntities 730,572 730,572 0 0.0%
AST.NumUsedConformances 226,737 226,737 0 0.0%
IRModule.NumIRBasicBlocks 3,257,194 3,257,194 0 0.0%
IRModule.NumIRFunctions 1,506,695 1,506,695 0 0.0%
IRModule.NumIRGlobals 1,628,697 1,628,697 0 0.0%
IRModule.NumIRInsts 29,746,276 29,746,276 0 0.0%
IRModule.NumIRValueSymbols 2,922,316 2,922,316 0 0.0%
LLVM.NumLLVMBytesOutput 796,757,694 796,760,410 2,716 0.0%
SILModule.NumSILGenFunctions 649,195 649,195 0 0.0%
SILModule.NumSILOptFunctions 880,772 880,772 0 0.0%
Sema.NumConformancesDeserialized 2,205,726 2,205,726 0 0.0%
Sema.NumConstraintScopes 15,240,000 15,240,000 0 0.0%
Sema.NumDeclsDeserialized 5,932,645 5,932,645 0 0.0%
Sema.NumDeclsValidated 1,031,564 1,031,564 0 0.0%
Sema.NumFunctionsTypechecked 426,148 426,148 0 0.0%
Sema.NumGenericSignatureBuilders 188,723 188,723 0 0.0%
Sema.NumLazyGenericEnvironments 1,221,006 1,221,006 0 0.0%
Sema.NumLazyGenericEnvironmentsLoaded 21,364 21,364 0 0.0%
Sema.NumLazyIterableDeclContexts 750,200 750,200 0 0.0%
Sema.NumTypesDeserialized 3,137,075 3,137,075 0 0.0%
Sema.NumTypesValidated 613,297 613,297 0 0.0%

@jrose-apple
Copy link
Contributor Author

@swift-ci Please test Linux

Like I just did for DeclDeserializer. This one adds the new class and
moves most of getTypeChecked() into it, but doesn't yet split anything
up.
Decls need to do this to avoid re-entrancy issues, but it turns out
types are simpler. I left a dummy "result" variable in the minimize
churn, since I'm going to move all the cases into their own functions
anyway.
It still has side effects, and it's still a lambda rather than a
helper function because it's not used anywhere else, but `[&]`
captures in helper lambdas make me nervous (as opposed to callback
lambdas).
@jrose-apple
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 4db46b0

@jrose-apple
Copy link
Contributor Author

@swift-ci Please test macOS

@jrose-apple
Copy link
Contributor Author

Oh hooray I forgot to merge this yesterday. Let's make sure it still works.

@swift-ci Please smoke test

@jrose-apple
Copy link
Contributor Author

@swift-ci Please smoke test macOS

@jrose-apple jrose-apple merged commit 5dc6e22 into swiftlang:master Feb 27, 2019
@jrose-apple jrose-apple deleted the TypeDeserializer branch February 27, 2019 03:10
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