Skip to content

Requestify ExportedSourceFile parsing #66029

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 3 commits into from
May 22, 2023

Conversation

hamishknight
Copy link
Contributor

Avoid parsing the syntax tree up-front, and instead only parse it when required, which happens when either:

  1. ASTGen parsing is enabled (currently disabled by default)
  2. Round trip checking is enabled for a primary file (enabled by default in a debug build, except when dep scanning or doing an IDE operation)
  3. We need to evaluate a macro in that file

This change therefore means that we now no longer need to parse the syntax tree for secondary files by default unless we specifically need to evaluate a macro in them (e.g if we need to lookup a member on a decl with an attached macro). And the same for primaries in release builds.

rdar://109283847

!Context.LangOpts.hasFeature(Feature::ParserASTGen)) {
// We only need to do parsing if we either have ASTGen enabled, or want the
// new parser diagnostics.
auto needToParse = [&]() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this to avoid negating the if's here 😅?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I originally wrote it as:

    if (!parsingOpts.contains(ParsingFlags::EnableASTGen) &&
        !(parsingOpts.contains(ParsingFlags::EnableASTGenDiagnostics) && !suppressDiagnostics))
      return;

and then I said to myself: "I'd hate to read that code if I ever saw it in the wild", and so rewrote it as this 😅

Copy link
Contributor

Choose a reason for hiding this comment

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

You could split it across two if and just negate with an or instead:

if (!parsingOpts.contains(ParsingFlags::EnableASTGen)) {
  if (!parsingOpts.contains(ParsingFlags::EnableASTGenDiagnostics) || suppressDiagnostics)
    return
}

I don't have a strong preference. I think yours is probably clearer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm I kind of also dislike that too

// RUN: %target-swift-frontend -typecheck -swift-version 5 -load-plugin-library %t/%target-library-name(MacroDefinition) -stats-output-dir %t/stats-no-lookup -primary-file %t/b.swift %t/a.swift
// RUN: %target-swift-frontend -typecheck -swift-version 5 -load-plugin-library %t/%target-library-name(MacroDefinition) -stats-output-dir %t/stats-lookup -primary-file %t/c.swift %t/a.swift

// RUN: %{python} %utils/process-stats-dir.py --evaluate-delta 'ExportedSourceFileRequest > 0' %t/stats-no-lookup %t/stats-lookup
Copy link
Contributor

Choose a reason for hiding this comment

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

Am I correct in my understanding that this is checking that there's more ExportedSourceFileRequests in lookup than no lookup? Ie. it's possible we could still have lookups in both? Is it worth doing a check similar to ensure_no_astgen.swift for the no lookup case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Am I correct in my understanding that this is checking that there's more ExportedSourceFileRequests in lookup than no lookup?

Yeah

it's possible we could still have lookups in both?

I guess it would be possible if we had a rogue SourceFile or something, or the caching of the request was broken, but otherwise the maximum should be 2, right?

I was trying to write this test bearing in mind that the numbers will change based on debug/release due to the round-trip checking. That being said, I realize now it won't work as expected because process-stats-dir doesn't handle missing counters well :/ Let me see if I can come up with something better.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Figured I should just go ahead and fix the stat printing logic to output 0 counters, so updated this to check the absolute counters for both runs (but we still need to use <= to account for difference in debug vs release)

@hamishknight hamishknight force-pushed the you-shall-not-parse branch from 37ec11a to 5988d4e Compare May 19, 2023 23:04
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.

Thank you for doing this! Is there a way we can set up the diagnostic printer to use this, too? We end up reparsing when printing diagnostics, which seems a bit ridiculous, but the layering is unfortunate.

@hamishknight
Copy link
Contributor Author

Seems like some flakiness is going on with the source compat suite, sometimes UPASS, sometimes XFAIL...

https://ci.swift.org/job/swift-PR-compiler-performance-macOS/63/

Comment from the run:

Summary for main full

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 145,026,849,632,443 122,931,368,255,179 -22,095,481,377,264 -15.24% ✅
Unchanged (delta < 1.0% or delta < 100.0ms) (1)
name old new delta delta_pct
LLVM.NumLLVMBytesOutput 2,443,809,896 2,443,852,960 43,064 0.0%

debug-batch detailed

Regressed (9)
name old new delta delta_pct
AST.NumSourceLinesPerSecond 3,700,336 5,018,529 1,318,193 35.62% ⛔
Sema.AccessLevelRequest 18,775,402 19,128,420 353,017 1.88% ⛔
Sema.AttachedPropertyWrappersRequest 22,945,745 23,198,778 253,033 1.1% ⛔
Sema.CollectOverriddenDeclsRequest 15,173,002 15,469,387 296,385 1.95% ⛔
Sema.LookupAllConformancesInContextRequest 3,148,295 3,189,023 40,728 1.29% ⛔
Sema.PrimaryAssociatedTypesRequest 19,493 19,695 202 1.04% ⛔
Sema.ProvideDefaultImplForRequest 15,173,002 15,469,387 296,385 1.95% ⛔
Sema.SimpleDidSetRequest 3,723,513 3,791,746 68,233 1.83% ⛔
Sema.USRGenerationRequest 16,910,985 17,213,874 302,889 1.79% ⛔
Improved (3)
name old new delta delta_pct
AST.ModuleShadowCacheHit 56,971 55,510 -1,461 -2.56% ✅
AST.ModuleShadowCacheMiss 4,494 4,426 -68 -1.51% ✅
Frontend.NumInstructionsExecuted 145,026,849,632,443 122,931,368,255,179 -22,095,481,377,264 -15.24% ✅
Unchanged (delta < 1.0% or delta < 100.0ms) (308)
name old new delta delta_pct
AST.ImportSetCacheHit 4,968,569 4,968,810 241 0.0%
AST.ImportSetCacheMiss 793,969 793,971 1 0.0%
AST.ImportSetFoldHit 402,528 402,505 -23 -0.01%
AST.ImportSetFoldMiss 391,441 391,466 25 0.01%
AST.ModuleVisibilityCacheHit 27,662,049 27,662,049 0 0.0%
AST.ModuleVisibilityCacheMiss 209,685 209,685 0 0.0%
AST.NumASTBytesAllocated 66,050,072,262 66,242,215,133 192,142,870 0.29%
AST.NumASTScopeExpansions 8,308,002 8,308,205 203 0.0%
AST.NumASTScopeLookups 9,532,495 9,533,065 569 0.01%
AST.NumDecls 340,649 340,649 0 0.0%
AST.NumDependencies 441,698 441,699 1 0.0%
AST.NumIncrementalDependencies 25,214 25,214 0 0.0%
AST.NumLinkLibraries 0 0 0 0.0%
AST.NumLoadedModules 322,695 322,695 0 0.0%
AST.NumLocalTypeDecls 6,522 6,522 0 0.0%
AST.NumModuleLookupClassMember 6,798 6,798 0 0.0%
AST.NumModuleLookupValue 163,313,265 163,311,373 -1,891 -0.0%
AST.NumObjCMethods 93,972 93,972 0 0.0%
AST.NumOperators 1,028 1,028 0 0.0%
AST.NumPrecedenceGroups 176 176 0 0.0%
AST.NumReferencedDynamicNames 159 159 0 0.0%
AST.NumReferencedMemberNames 14,969,282 14,969,274 -8 -0.0%
AST.NumReferencedTopLevelNames 1,342,507 1,342,507 0 0.0%
AST.NumSourceBuffers 395,204 395,204 0 0.0%
AST.NumSourceLines 12,356,688 12,356,688 0 0.0%
AST.NumTotalClangImportedEntities 1,954,415 1,956,895 2,480 0.13%
Frontend.MaxMallocUsage 0 0 0 0.0%
Frontend.NumProcessFailures 31 31 0 0.0%
IRGen.IRGenRequest 29,478 29,478 0 0.0%
IRGen.OptimizedIRRequest 0 0 0 0.0%
IRGen.SymbolObjectCodeRequest 0 0 0 0.0%
IRModule.NumGOTEntries 297,857 297,857 0 0.0%
IRModule.NumIRAliases 239,487 239,487 0 0.0%
IRModule.NumIRBasicBlocks 8,261,723 8,261,723 0 0.0%
IRModule.NumIRComdatSymbols 0 0 0 0.0%
IRModule.NumIRFunctions 4,497,009 4,497,009 0 0.0%
IRModule.NumIRGlobals 4,273,592 4,273,592 0 0.0%
IRModule.NumIRIFuncs 0 0 0 0.0%
IRModule.NumIRInsts 105,576,298 105,576,298 0 0.0%
IRModule.NumIRNamedMetaData 119,432 119,432 0 0.0%
IRModule.NumIRValueSymbols 8,842,460 8,842,460 0 0.0%
LLVM.NumLLVMBytesOutput 2,443,809,896 2,443,852,960 43,064 0.0%
Parse.IDEInspectionSecondPassRequest 0 0 0 0.0%
Parse.NumFunctionsParsed 396,751 396,751 0 0.0%
Parse.NumIterableDeclContextParsed 805,328 805,334 6 0.0%
Parse.ParseAbstractFunctionBodyRequest 684,546 684,546 0 0.0%
Parse.ParseMembersRequest 617,180 617,186 6 0.0%
Parse.ParseSourceFileRequest 369,509 369,509 0 0.0%
Parse.ParseTopLevelDeclsRequest 369,509 369,509 0 0.0%
SILGen.ASTLoweringRequest 30,813 30,813 0 0.0%
SILGen.ParseSILModuleRequest 0 0 0 0.0%
SILModule.NumSILGenDefaultWitnessTables 0 0 0 0.0%
SILModule.NumSILGenFunctions 3,511,580 3,511,580 0 0.0%
SILModule.NumSILGenGlobalVariables 140,013 140,013 0 0.0%
SILModule.NumSILGenVtables 40,379 40,379 0 0.0%
SILModule.NumSILGenWitnessTables 197,169 197,169 0 0.0%
SILModule.NumSILOptDefaultWitnessTables 0 0 0 0.0%
SILModule.NumSILOptFunctions 4,011,125 4,011,125 0 0.0%
SILModule.NumSILOptGlobalVariables 142,008 142,008 0 0.0%
SILModule.NumSILOptVtables 40,742 40,742 0 0.0%
SILModule.NumSILOptWitnessTables 240,557 240,557 0 0.0%
SILOptimizer.ExecuteSILPipelineRequest 151,423 151,423 0 0.0%
SILOptimizer.LoweredSILRequest 0 0 0 0.0%
Sema.ABIMembersRequest 309,274 309,274 0 0.0%
Sema.AbstractGenericSignatureRequest 145,559 145,970 410 0.28%
Sema.ActorIsolationRequest 7,118,667 7,119,546 879 0.01%
Sema.AllMembersRequest 117,897 117,897 0 0.0%
Sema.AnyObjectLookupRequest 234 234 0 0.0%
Sema.ApplyAccessNoteRequest 4,363,854 4,366,559 2,705 0.06%
Sema.AreAllStoredPropertiesDefaultInitableRequest 49,574 49,574 0 0.0%
Sema.AttachedPropertyWrapperTypeRequest 30,646 30,646 0 0.0%
Sema.AttachedResultBuilderRequest 1,880,502 1,880,502 0 0.0%
Sema.BodyInitKindRequest 94,303 94,303 0 0.0%
Sema.BreakTargetRequest 6,567 6,567 0 0.0%
Sema.CXXNamespaceMemberLookup 0 0 0 0.0%
Sema.CallerSideDefaultArgExprRequest 479,669 479,669 0 0.0%
Sema.CheckDistributedFunctionRequest 80 80 0 0.0%
Sema.CheckInconsistentAccessLevelOnImport 59,478 59,478 0 0.0%
Sema.CheckInconsistentImplementationOnlyImportsRequest 10,759 10,759 0 0.0%
Sema.CheckInconsistentSPIOnlyImportsRequest 59,478 59,478 0 0.0%
Sema.CheckInconsistentWeakLinkedImportsRequest 10,759 10,759 0 0.0%
Sema.CheckRedeclarationRequest 2,331,978 2,331,978 0 0.0%
Sema.ClangCategoryLookupRequest 0 0 0 0.0%
Sema.ClangDirectLookupRequest 15,213 15,213 0 0.0%
Sema.ClangRecordMemberLookup 15,213 15,213 0 0.0%
Sema.ClassAncestryFlagsRequest 152,942 153,162 219 0.14%
Sema.ClosureEffectsRequest 152,909 152,909 0 0.0%
Sema.ClosureHasExplicitResultRequest 58,742 58,742 0 0.0%
Sema.CompareDeclSpecializationRequest 870,623 871,970 1,347 0.15%
Sema.CompilerPluginLoadRequest 0 0 0 0.0%
Sema.ConditionalRequirementsRequest 876,356 879,184 2,827 0.32%
Sema.ConformanceHasEffectRequest 63 63 0 0.0%
Sema.ConstantValueInfoRequest 0 0 0 0.0%
Sema.ContinueTargetRequest 2,180 2,180 0 0.0%
Sema.CursorInfoRequest 0 0 0 0.0%
Sema.CustomAttrNominalRequest 22,083 22,083 0 0.0%
Sema.CustomAttrTypeRequest 3,280 3,280 0 0.0%
Sema.CustomRefCountingOperation 0 0 0 0.0%
Sema.CxxRecordAsSwiftType 0 0 0 0.0%
Sema.CxxRecordSemantics 85,514 85,605 91 0.11%
Sema.DefaultAndMaxAccessLevelRequest 121,658 121,658 0 0.0%
Sema.DefaultArgumentExprRequest 103,047 103,047 0 0.0%
Sema.DefaultArgumentInitContextRequest 841 841 0 0.0%
Sema.DefaultArgumentTypeRequest 21,688 21,688 0 0.0%
Sema.DefaultDefinitionTypeRequest 8,506 8,506 0 0.0%
Sema.DefaultTypeRequest 655,408 655,408 0 0.0%
Sema.DerivativeAttrOriginalDeclRequest 0 0 0 0.0%
Sema.DifferentiableAttributeTypeCheckRequest 0 0 0 0.0%
Sema.DirectLookupRequest 80,958,563 81,087,365 128,802 0.16%
Sema.DirectOperatorLookupRequest 2,577,648 2,576,481 -1,167 -0.05%
Sema.DirectPrecedenceGroupLookupRequest 951,307 951,307 0 0.0%
Sema.DistributedModuleIsAvailableRequest 67 67 0 0.0%
Sema.DynamicallyReplacedDeclRequest 7,566,094 7,566,970 876 0.01%
Sema.EnumElementExprPatternRequest 17 17 0 0.0%
Sema.EnumRawTypeRequest 41,362 41,362 0 0.0%
Sema.EnumRawValuesRequest 24,332 24,332 0 0.0%
Sema.ExistentialConformsToSelfRequest 33,909 33,890 -19 -0.06%
Sema.ExpandAccessorMacros 1,303,150 1,303,150 0 0.0%
Sema.ExpandConformanceMacros 1,292,664 1,297,000 4,335 0.34%
Sema.ExpandMacroExpansionDeclRequest 0 0 0 0.0%
Sema.ExpandMacroExpansionExprRequest 0 0 0 0.0%
Sema.ExpandMemberAttributeMacros 74,722,659 75,413,625 690,966 0.92%
Sema.ExpandPeerMacroRequest 10,278,153 10,278,153 0 0.0%
Sema.ExpandSynthesizedMemberMacroRequest 303,199 303,199 0 0.0%
Sema.ExprPatternMatchRequest 92,535 92,535 0 0.0%
Sema.ExtendedNominalRequest 706,326 706,326 0 0.0%
Sema.ExtendedTypeRequest 217,307 217,307 0 0.0%
Sema.ExternalMacroDefinitionRequest 0 0 0 0.0%
Sema.FragileFunctionKindRequest 2,791,267 2,791,267 0 0.0%
Sema.FunctionOperatorRequest 20,338 20,338 0 0.0%
Sema.GenericParamListRequest 7,387,600 7,400,295 12,695 0.17%
Sema.GenericSignatureRequest 3,622,991 3,626,150 3,159 0.09%
Sema.GetDestructorRequest 47,188 47,188 0 0.0%
Sema.GetDistributedActorArgumentDecodingMethodRequest 19 19 0 0.0%
Sema.GetDistributedActorIDPropertyRequest 72 72 0 0.0%
Sema.GetDistributedActorImplicitCodableRequest 117 117 0 0.0%
Sema.GetDistributedActorInvocationDecoderRequest 19 19 0 0.0%
Sema.GetDistributedActorSystemPropertyRequest 63 63 0 0.0%
Sema.GetDistributedActorSystemRemoteCallFunctionRequest 46 46 0 0.0%
Sema.GetDistributedRemoteCallArgumentInitFunctionRequest 19 19 0 0.0%
Sema.GetDistributedRemoteCallTargetInitFunctionRequest 19 19 0 0.0%
Sema.GetDistributedTargetInvocationDecoderDecodeNextArgumentFunctionRequest 22 22 0 0.0%
Sema.GetDistributedTargetInvocationEncoderRecordArgumentFunctionRequest 20 20 0 0.0%
Sema.GetDistributedTargetInvocationEncoderRecordErrorTypeFunctionRequest 11 11 0 0.0%
Sema.GetDistributedTargetInvocationEncoderRecordReturnTypeFunctionRequest 16 16 0 0.0%
Sema.GetDistributedTargetInvocationResultHandlerOnReturnFunctionRequest 12 12 0 0.0%
Sema.GetDistributedThunkRequest 80 80 0 0.0%
Sema.GetImplicitSendableRequest 265,055 263,360 -1,695 -0.64%
Sema.GetRuntimeDiscoverableAttributes 2,453,177 2,453,177 0 0.0%
Sema.GetSourceFileAsyncNode 138 138 0 0.0%
Sema.GlobalActorAttributeRequest 9,041,559 9,043,185 1,626 0.02%
Sema.GlobalActorInstanceRequest 1,063 1,063 0 0.0%
Sema.HasCircularInheritedProtocolsRequest 18,513 18,513 0 0.0%
Sema.HasCircularRawValueRequest 25,096 25,096 0 0.0%
Sema.HasDefaultInitRequest 106,862 106,862 0 0.0%
Sema.HasDynamicCallableAttributeRequest 31,859 31,859 0 0.0%
Sema.HasDynamicMemberLookupAttributeRequest 581,014 581,739 725 0.12%
Sema.HasImportsMatchingFlagRequest 733,008 733,008 0 0.0%
Sema.HasIsolatedSelfRequest 15,938,580 16,041,413 102,833 0.65%
Sema.HasMemberwiseInitRequest 52,221 52,221 0 0.0%
Sema.HasMissingDesignatedInitializersRequest 33,330 33,330 0 0.0%
Sema.HasSelfOrAssociatedTypeRequirementsRequest 16,730 16,730 0 0.0%
Sema.HasUserDefinedDesignatedInitRequest 106,872 106,872 0 0.0%
Sema.IDEInspectionFileRequest 0 0 0 0.0%
Sema.InferredGenericSignatureRequest 242,028 242,028 0 0.0%
Sema.InheritedDeclsReferencedRequest 7,816,620 7,877,659 61,039 0.78%
Sema.InheritedProtocolsRequest 865,895 866,569 674 0.08%
Sema.InheritedTypeRequest 473,445 473,461 16 0.0%
Sema.InheritsSuperclassInitializersRequest 42,292 42,292 0 0.0%
Sema.InitKindRequest 197,260 197,260 0 0.0%
Sema.InterfaceTypeRequest 24,458,480 24,702,333 243,852 1.0%
Sema.IsABICompatibleOverrideRequest 322,051 322,051 0 0.0%
Sema.IsAccessorTransparentRequest 576,041 576,041 0 0.0%
Sema.IsActorRequest 2,521,455 2,525,095 3,640 0.14%
Sema.IsCallAsFunctionNominalRequest 6,761 6,761 0 0.0%
Sema.IsDeclApplicableRequest 0 0 0 0.0%
Sema.IsDeclRefinementOfRequest 71,755 71,755 0 0.0%
Sema.IsDefaultActorRequest 63,944 63,944 0 0.0%
Sema.IsDistributedActorRequest 2,807,705 2,812,274 4,569 0.16%
Sema.IsDynamicRequest 3,285,947 3,285,947 0 0.0%
Sema.IsFinalRequest 5,003,230 5,038,396 35,166 0.7%
Sema.IsGetterMutatingRequest 827,800 827,800 0 0.0%
Sema.IsImplicitlyUnwrappedOptionalRequest 4,076,002 4,075,674 -327 -0.01%
Sema.IsMoveOnlyRequest 781,894 782,244 349 0.04%
Sema.IsNonUserModuleRequest 104,502 104,355 -147 -0.14%
Sema.IsObjCRequest 3,056,827 3,059,532 2,705 0.09%
Sema.IsSafeUseOfCxxDecl 0 0 0 0.0%
Sema.IsSetterMutatingRequest 742,425 742,425 0 0.0%
Sema.IsSingleValueStmtRequest 374,454 374,454 0 0.0%
Sema.IsStaticRequest 1,660,833 1,661,096 262 0.02%
Sema.LazyStoragePropertyRequest 2,573 2,573 0 0.0%
Sema.LocalDiscriminatorsRequest 551,530 551,530 0 0.0%
Sema.LookupConformanceInModuleRequest 128,500,220 128,983,031 482,811 0.38%
Sema.LookupInModuleRequest 11,145,919 11,141,887 -4,032 -0.04%
Sema.LookupInfixOperatorRequest 82,322 82,322 0 0.0%
Sema.LookupPostfixOperatorRequest 74 74 0 0.0%
Sema.LookupPrecedenceGroupRequest 33,550 33,550 0 0.0%
Sema.LookupPrefixOperatorRequest 452 452 0 0.0%
Sema.MacroDefinitionRequest 0 0 0 0.0%
Sema.MangleLocalTypeDeclRequest 3,149 3,149 0 0.0%
Sema.ModuleImplicitImportsRequest 10,759 10,759 0 0.0%
Sema.ModuleLibraryLevelRequest 22 22 0 0.0%
Sema.ModuleQualifiedLookupRequest 4,055,233 4,050,632 -4,601 -0.11%
Sema.NamedLazyMemberLoadSuccessCount 37,940,480 37,923,536 -16,944 -0.04%
Sema.NamingPatternRequest 242,249 242,249 0 0.0%
Sema.NeedsNewVTableEntryRequest 1,072,248 1,072,248 0 0.0%
Sema.NumAccessorBodiesSynthesized 480,199 480,199 0 0.0%
Sema.NumAccessorsSynthesized 579,269 579,269 0 0.0%
Sema.NumConformancePathsRecorded 996,792 997,326 534 0.05%
Sema.NumConformancesDeserialized 6,238,530 6,290,075 51,544 0.83%
Sema.NumConstraintScopes 80,307,034 80,321,129 14,094 0.02%
Sema.NumConstraintsConsideredForEdgeContraction 2,726,255 2,726,255 0 0.0%
Sema.NumCrossImportsChecked 0 0 0 0.0%
Sema.NumCrossImportsFound 0 0 0 0.0%
Sema.NumCyclicOneWayComponentsCollapsed 0 0 0 0.0%
Sema.NumDeclsDeserialized 119,615,768 120,342,035 726,266 0.61%
Sema.NumDeclsTypechecked 3,314,288 3,314,288 0 0.0%
Sema.NumLazyIterableDeclContexts 15,587,344 15,603,145 15,801 0.1%
Sema.NumLazyRequirementSignatures 1,191,573 1,191,956 383 0.03%
Sema.NumLazyRequirementSignaturesLoaded 792,157 792,750 592 0.07%
Sema.NumLeafScopes 61,816,346 61,828,324 11,977 0.02%
Sema.NumRequirementMachineCompletionSteps 29,848,554 30,011,691 163,137 0.55%
Sema.NumRequirementMachineUnifiedConcreteTerms 1,369,732 1,372,571 2,838 0.21%
Sema.NumRequirementMachines 2,341,034 2,349,659 8,625 0.37%
Sema.NumTypesDeserialized 32,961,860 33,039,154 77,293 0.23%
Sema.NumUnloadedLazyIterableDeclContexts 8,809,499 8,786,115 -23,383 -0.27%
Sema.ObjCInterfaceAndImplementationRequest 949,355 949,352 -2 -0.0%
Sema.OpaqueReadOwnershipRequest 502,884 502,884 0 0.0%
Sema.OpaqueResultTypeRequest 513 513 0 0.0%
Sema.OperatorPrecedenceGroupRequest 1,027 1,027 0 0.0%
Sema.OverriddenDeclsRequest 6,659,772 6,674,377 14,605 0.22%
Sema.ParamSpecifierRequest 2,243,953 2,243,953 0 0.0%
Sema.PatternBindingEntryRequest 817,936 817,936 0 0.0%
Sema.PatternTypeRequest 969,967 969,967 0 0.0%
Sema.PolymorphicEffectKindRequest 1,121,023 1,121,023 0 0.0%
Sema.PolymorphicEffectRequirementsRequest 75 75 0 0.0%
Sema.PreCheckResultBuilderRequest 951 951 0 0.0%
Sema.PreCheckReturnStmtRequest 595,368 595,368 0 0.0%
Sema.PrimarySourceFilesRequest 10,759 10,759 0 0.0%
Sema.PropertyWrapperAuxiliaryVariablesRequest 2,452,273 2,452,273 0 0.0%
Sema.PropertyWrapperBackingPropertyTypeRequest 30,646 30,646 0 0.0%
Sema.PropertyWrapperInitializerInfoRequest 715,935 715,935 0 0.0%
Sema.PropertyWrapperLValuenessRequest 2,636 2,636 0 0.0%
Sema.PropertyWrapperMutabilityRequest 821,669 821,669 0 0.0%
Sema.PropertyWrapperTypeInfoRequest 599 599 0 0.0%
Sema.ProtocolDependenciesRequest 678,535 679,022 487 0.07%
Sema.ProtocolRequirementsRequest 81,344 81,344 0 0.0%
Sema.ProtocolRequiresClassRequest 47,887 47,920 32 0.07%
Sema.QualifiedLookupRequest 10,031,616 10,050,674 19,058 0.19%
Sema.RangeInfoRequest 0 0 0 0.0%
Sema.RawCommentRequest 1,185,057 1,185,057 0 0.0%
Sema.RenamedDeclRequest 5,221 5,221 0 0.0%
Sema.RequirementRequest 194,117 194,117 0 0.0%
Sema.RequirementSignatureRequest 851,585 852,229 644 0.08%
Sema.RequiresOpaqueAccessorsRequest 2,100,358 2,100,358 0 0.0%
Sema.RequiresOpaqueModifyCoroutineRequest 508,305 508,305 0 0.0%
Sema.ResolveEffectiveMemberwiseInitRequest 0 0 0 0.0%
Sema.ResolveImplicitMemberRequest 947,225 949,992 2,766 0.29%
Sema.ResolveMacroRequest 24,989 24,989 0 0.0%
Sema.ResolveProtocolNameRequest 0 0 0 0.0%
Sema.ResolveTypeEraserTypeRequest 0 0 0 0.0%
Sema.ResolveTypeRequest 5,759,029 5,759,029 0 0.0%
Sema.ResultBuilderTypeRequest 555,155 555,155 0 0.0%
Sema.ResultTypeRequest 1,259,221 1,259,221 0 0.0%
Sema.RootAndResultTypeOfKeypathDynamicMemberRequest 0 0 0 0.0%
Sema.RootTypeOfKeypathDynamicMemberRequest 0 0 0 0.0%
Sema.SPIGroupsRequest 8,790,286 8,818,105 27,819 0.32%
Sema.ScopedImportLookupRequest 936 936 0 0.0%
Sema.SelfAccessKindRequest 1,044,405 1,044,652 247 0.02%
Sema.SelfBoundsFromGenericSignatureRequest 92,500 92,500 0 0.0%
Sema.SelfBoundsFromWhereClauseRequest 2,039,969 2,045,191 5,222 0.26%
Sema.SemanticAvailableRangeAttrRequest 8,073 8,073 0 0.0%
Sema.SemanticBriefCommentRequest 199,440 199,440 0 0.0%
Sema.SemanticUnavailableAttrRequest 2,958,642 2,958,642 0 0.0%
Sema.SetterAccessLevelRequest 286,149 286,149 0 0.0%
Sema.SpecializeAttrTargetDeclRequest 3,088 3,088 0 0.0%
Sema.StorageImplInfoRequest 2,414,035 2,414,035 0 0.0%
Sema.StoredPropertiesAndMissingMembersRequest 71,963 71,963 0 0.0%
Sema.StoredPropertiesRequest 424,684 424,679 -5 -0.0%
Sema.StructuralRequirementsRequest 59,616 59,667 51 0.09%
Sema.StructuralTypeRequest 2,164 2,164 0 0.0%
Sema.SuperclassDeclRequest 578,444 578,934 490 0.08%
Sema.SuperclassTypeRequest 74,123 74,120 -2 -0.0%
Sema.SynthesizeAccessorRequest 579,269 579,269 0 0.0%
Sema.SynthesizeDefaultInitRequest 13,983 13,983 0 0.0%
Sema.SynthesizeMainFunctionRequest 267,657 267,657 0 0.0%
Sema.SynthesizeMemberwiseInitRequest 11,289 11,289 0 0.0%
Sema.SynthesizeRuntimeMetadataAttrGenerator 0 0 0 0.0%
Sema.SynthesizeRuntimeMetadataAttrGeneratorBody 0 0 0 0.0%
Sema.TangentStoredPropertyRequest 0 0 0 0.0%
Sema.TypeAliasRequirementsRequest 59,616 59,667 51 0.09%
Sema.TypeCheckASTNodeAtLocRequest 0 0 0 0.0%
Sema.TypeCheckFunctionBodyRequest 1,031,295 1,031,295 0 0.0%
Sema.TypeCheckObjCImplementationRequest 0 0 0 0.0%
Sema.TypeCheckSourceFileRequest 59,478 59,478 0 0.0%
Sema.TypeDeclsFromWhereClauseRequest 60,122 60,122 0 0.0%
Sema.TypeEraserHasViableInitRequest 0 0 0 0.0%
Sema.TypeRelationCheckRequest 0 0 0 0.0%
Sema.TypeWitnessRequest 18,150 18,150 0 0.0%
Sema.UnderlyingTypeDeclsReferencedRequest 373,674 375,018 1,343 0.36%
Sema.UnderlyingTypeRequest 60,301 60,301 0 0.0%
Sema.UnqualifiedLookupRequest 8,339,971 8,340,541 569 0.01%
Sema.ValidatePrecedenceGroupRequest 270,465 270,465 0 0.0%
Sema.ValueWitnessRequest 80,164 80,164 0 0.0%
TBDGen.APIGenRequest 0 0 0 0.0%
TBDGen.GenerateTBDRequest 0 0 0 0.0%
TBDGen.PublicSymbolsRequest 29,492 29,492 0 0.0%
TBDGen.SymbolSourceMapRequest 0 0 0 0.0%

Release

release brief

Regressed (0)
name old new delta delta_pct
Improved (1)
name old new delta delta_pct
Frontend.NumInstructionsExecuted 94,242,342,333,007 89,601,443,371,323 -4,640,898,961,684 -4.92% ✅
Unchanged (delta < 1.0% or delta < 100.0ms) (1)
name old new delta delta_pct
LLVM.NumLLVMBytesOutput 2,120,588,156 2,120,620,196 32,040 0.0%

release detailed

Regressed (1)
name old new delta delta_pct
AST.NumSourceLinesPerSecond 319,919 357,563 37,643 11.77% ⛔
Improved (1)
name old new delta delta_pct
Frontend.NumInstructionsExecuted 94,242,342,333,007 89,601,443,371,323 -4,640,898,961,684 -4.92% ✅
Unchanged (delta < 1.0% or delta < 100.0ms) (318)
name old new delta delta_pct
AST.ImportSetCacheHit 2,209,686 2,209,686 0 0.0%
AST.ImportSetCacheMiss 84,830 84,830 0 0.0%
AST.ImportSetFoldHit 45,323 45,323 0 0.0%
AST.ImportSetFoldMiss 39,507 39,507 0 0.0%
AST.ModuleShadowCacheHit 4,293 4,293 0 0.0%
AST.ModuleShadowCacheMiss 1,342 1,342 0 0.0%
AST.ModuleVisibilityCacheHit 12,950,094 12,950,094 0 0.0%
AST.ModuleVisibilityCacheMiss 39,726 39,726 0 0.0%
AST.NumASTBytesAllocated 11,827,332,948 11,827,057,980 -274,968 -0.0%
AST.NumASTScopeExpansions 3,595,124 3,595,124 0 0.0%
AST.NumASTScopeLookups 4,940,486 4,940,486 0 0.0%
AST.NumDecls 178,387 178,387 0 0.0%
AST.NumDependencies 55,941 55,941 0 0.0%
AST.NumIncrementalDependencies 58 58 0 0.0%
AST.NumLinkLibraries 0 0 0 0.0%
AST.NumLoadedModules 30,818 30,818 0 0.0%
AST.NumLocalTypeDecls 296 296 0 0.0%
AST.NumModuleLookupClassMember 6,680 6,680 0 0.0%
AST.NumModuleLookupValue 63,653,920 63,653,920 0 0.0%
AST.NumObjCMethods 19,462 19,462 0 0.0%
AST.NumOperators 515 515 0 0.0%
AST.NumPrecedenceGroups 90 90 0 0.0%
AST.NumReferencedDynamicNames 0 0 0 0.0%
AST.NumReferencedMemberNames 4,234 4,234 0 0.0%
AST.NumReferencedTopLevelNames 352 352 0 0.0%
AST.NumSourceBuffers 37,376 37,376 0 0.0%
AST.NumSourceLines 6,120,665 6,120,665 0 0.0%
AST.NumTotalClangImportedEntities 457,871 457,871 0 0.0%
Frontend.MaxMallocUsage 0 0 0 0.0%
Frontend.NumProcessFailures 2 2 0 0.0%
IRGen.IRGenRequest 12 12 0 0.0%
IRGen.OptimizedIRRequest 0 0 0 0.0%
IRGen.SymbolObjectCodeRequest 0 0 0 0.0%
IRModule.NumGOTEntries 259,312 259,312 0 0.0%
IRModule.NumIRAliases 155,123 155,123 0 0.0%
IRModule.NumIRBasicBlocks 5,619,584 5,619,584 0 0.0%
IRModule.NumIRComdatSymbols 0 0 0 0.0%
IRModule.NumIRFunctions 3,014,166 3,014,166 0 0.0%
IRModule.NumIRGlobals 3,412,804 3,412,804 0 0.0%
IRModule.NumIRIFuncs 0 0 0 0.0%
IRModule.NumIRInsts 54,411,325 54,411,325 0 0.0%
IRModule.NumIRNamedMetaData 112,784 112,784 0 0.0%
IRModule.NumIRValueSymbols 6,432,843 6,432,843 0 0.0%
LLVM.NumLLVMBytesOutput 2,120,588,156 2,120,620,196 32,040 0.0%
Parse.IDEInspectionSecondPassRequest 0 0 0 0.0%
Parse.NumFunctionsParsed 326,735 326,735 0 0.0%
Parse.NumIterableDeclContextParsed 127,509 127,509 0 0.0%
Parse.ParseAbstractFunctionBodyRequest 326,661 326,661 0 0.0%
Parse.ParseMembersRequest 14,232 14,232 0 0.0%
Parse.ParseSourceFileRequest 32,786 32,786 0 0.0%
Parse.ParseTopLevelDeclsRequest 32,786 32,786 0 0.0%
SILGen.ASTLoweringRequest 1,260 1,260 0 0.0%
SILGen.ParseSILModuleRequest 0 0 0 0.0%
SILModule.NumSILGenDefaultWitnessTables 830 830 0 0.0%
SILModule.NumSILGenFunctions 1,401,668 1,401,668 0 0.0%
SILModule.NumSILGenGlobalVariables 66,337 66,337 0 0.0%
SILModule.NumSILGenVtables 24,011 24,011 0 0.0%
SILModule.NumSILGenWitnessTables 87,268 87,268 0 0.0%
SILModule.NumSILOptDefaultWitnessTables 830 830 0 0.0%
SILModule.NumSILOptFunctions 1,160,062 1,160,062 0 0.0%
SILModule.NumSILOptGlobalVariables 48,245 48,245 0 0.0%
SILModule.NumSILOptVtables 27,989 27,989 0 0.0%
SILModule.NumSILOptWitnessTables 87,785 87,785 0 0.0%
SILOptimizer.ExecuteSILPipelineRequest 6,196 6,196 0 0.0%
SILOptimizer.LoweredSILRequest 0 0 0 0.0%
Sema.ABIMembersRequest 135,382 135,382 0 0.0%
Sema.AbstractGenericSignatureRequest 71,482 71,482 0 0.0%
Sema.AccessLevelRequest 1,963,295 1,963,295 0 0.0%
Sema.ActorIsolationRequest 2,215,408 2,215,408 0 0.0%
Sema.AllMembersRequest 110,184 110,184 0 0.0%
Sema.AnyObjectLookupRequest 236 236 0 0.0%
Sema.ApplyAccessNoteRequest 2,104,415 2,104,415 0 0.0%
Sema.AreAllStoredPropertiesDefaultInitableRequest 20,531 20,531 0 0.0%
Sema.AttachedPropertyWrapperTypeRequest 9,233 9,233 0 0.0%
Sema.AttachedPropertyWrappersRequest 3,872,614 3,872,614 0 0.0%
Sema.AttachedResultBuilderRequest 1,013,539 1,013,539 0 0.0%
Sema.BodyInitKindRequest 54,453 54,453 0 0.0%
Sema.BreakTargetRequest 5,317 5,317 0 0.0%
Sema.CXXNamespaceMemberLookup 0 0 0 0.0%
Sema.CallerSideDefaultArgExprRequest 139,711 139,711 0 0.0%
Sema.CheckDistributedFunctionRequest 42 42 0 0.0%
Sema.CheckInconsistentAccessLevelOnImport 32,762 32,762 0 0.0%
Sema.CheckInconsistentImplementationOnlyImportsRequest 1,262 1,262 0 0.0%
Sema.CheckInconsistentSPIOnlyImportsRequest 32,762 32,762 0 0.0%
Sema.CheckInconsistentWeakLinkedImportsRequest 1,262 1,262 0 0.0%
Sema.CheckRedeclarationRequest 1,243,177 1,243,177 0 0.0%
Sema.ClangCategoryLookupRequest 0 0 0 0.0%
Sema.ClangDirectLookupRequest 7,669 7,669 0 0.0%
Sema.ClangRecordMemberLookup 7,669 7,669 0 0.0%
Sema.ClassAncestryFlagsRequest 55,774 55,774 0 0.0%
Sema.ClosureEffectsRequest 106,213 106,213 0 0.0%
Sema.ClosureHasExplicitResultRequest 35,470 35,470 0 0.0%
Sema.CollectOverriddenDeclsRequest 20,724 20,724 0 0.0%
Sema.CompareDeclSpecializationRequest 472,224 472,224 0 0.0%
Sema.CompilerPluginLoadRequest 0 0 0 0.0%
Sema.ConditionalRequirementsRequest 226,021 226,021 0 0.0%
Sema.ConformanceHasEffectRequest 44 44 0 0.0%
Sema.ConstantValueInfoRequest 0 0 0 0.0%
Sema.ContinueTargetRequest 1,878 1,878 0 0.0%
Sema.CursorInfoRequest 0 0 0 0.0%
Sema.CustomAttrNominalRequest 8,527 8,527 0 0.0%
Sema.CustomAttrTypeRequest 761 761 0 0.0%
Sema.CustomRefCountingOperation 0 0 0 0.0%
Sema.CxxRecordAsSwiftType 0 0 0 0.0%
Sema.CxxRecordSemantics 18,730 18,730 0 0.0%
Sema.DefaultAndMaxAccessLevelRequest 57,548 57,548 0 0.0%
Sema.DefaultArgumentExprRequest 51,566 51,566 0 0.0%
Sema.DefaultArgumentInitContextRequest 141 141 0 0.0%
Sema.DefaultArgumentTypeRequest 8,459 8,459 0 0.0%
Sema.DefaultDefinitionTypeRequest 3,583 3,583 0 0.0%
Sema.DefaultTypeRequest 304,975 304,975 0 0.0%
Sema.DerivativeAttrOriginalDeclRequest 0 0 0 0.0%
Sema.DifferentiableAttributeTypeCheckRequest 0 0 0 0.0%
Sema.DirectLookupRequest 46,515,706 46,515,777 71 0.0%
Sema.DirectOperatorLookupRequest 1,662,688 1,662,688 0 0.0%
Sema.DirectPrecedenceGroupLookupRequest 684,777 684,777 0 0.0%
Sema.DistributedModuleIsAvailableRequest 33 33 0 0.0%
Sema.DynamicallyReplacedDeclRequest 2,409,763 2,409,763 0 0.0%
Sema.EnumElementExprPatternRequest 10 10 0 0.0%
Sema.EnumRawTypeRequest 11,252 11,252 0 0.0%
Sema.EnumRawValuesRequest 11,407 11,407 0 0.0%
Sema.ExistentialConformsToSelfRequest 6,700 6,700 0 0.0%
Sema.ExpandAccessorMacros 703,423 703,423 0 0.0%
Sema.ExpandConformanceMacros 179,941 179,941 0 0.0%
Sema.ExpandMacroExpansionDeclRequest 0 0 0 0.0%
Sema.ExpandMacroExpansionExprRequest 0 0 0 0.0%
Sema.ExpandMemberAttributeMacros 10,471,670 10,471,670 0 0.0%
Sema.ExpandPeerMacroRequest 3,333,634 3,333,634 0 0.0%
Sema.ExpandSynthesizedMemberMacroRequest 124,516 124,516 0 0.0%
Sema.ExprPatternMatchRequest 52,698 52,698 0 0.0%
Sema.ExtendedNominalRequest 63,366 63,366 0 0.0%
Sema.ExtendedTypeRequest 63,200 63,200 0 0.0%
Sema.ExternalMacroDefinitionRequest 0 0 0 0.0%
Sema.FragileFunctionKindRequest 1,177,869 1,177,869 0 0.0%
Sema.FunctionOperatorRequest 9,689 9,689 0 0.0%
Sema.GenericParamListRequest 1,715,798 1,715,798 0 0.0%
Sema.GenericSignatureRequest 1,212,738 1,212,738 0 0.0%
Sema.GetDestructorRequest 24,412 24,412 0 0.0%
Sema.GetDistributedActorArgumentDecodingMethodRequest 19 19 0 0.0%
Sema.GetDistributedActorIDPropertyRequest 32 32 0 0.0%
Sema.GetDistributedActorImplicitCodableRequest 56 56 0 0.0%
Sema.GetDistributedActorInvocationDecoderRequest 19 19 0 0.0%
Sema.GetDistributedActorSystemPropertyRequest 28 28 0 0.0%
Sema.GetDistributedActorSystemRemoteCallFunctionRequest 8 8 0 0.0%
Sema.GetDistributedRemoteCallArgumentInitFunctionRequest 5 5 0 0.0%
Sema.GetDistributedRemoteCallTargetInitFunctionRequest 5 5 0 0.0%
Sema.GetDistributedTargetInvocationDecoderDecodeNextArgumentFunctionRequest 5 5 0 0.0%
Sema.GetDistributedTargetInvocationEncoderRecordArgumentFunctionRequest 5 5 0 0.0%
Sema.GetDistributedTargetInvocationEncoderRecordErrorTypeFunctionRequest 3 3 0 0.0%
Sema.GetDistributedTargetInvocationEncoderRecordReturnTypeFunctionRequest 4 4 0 0.0%
Sema.GetDistributedTargetInvocationResultHandlerOnReturnFunctionRequest 1 1 0 0.0%
Sema.GetDistributedThunkRequest 42 42 0 0.0%
Sema.GetImplicitSendableRequest 49,287 49,287 0 0.0%
Sema.GetRuntimeDiscoverableAttributes 1,307,606 1,307,606 0 0.0%
Sema.GetSourceFileAsyncNode 67 67 0 0.0%
Sema.GlobalActorAttributeRequest 2,968,336 2,968,336 0 0.0%
Sema.GlobalActorInstanceRequest 195 195 0 0.0%
Sema.HasCircularInheritedProtocolsRequest 9,113 9,113 0 0.0%
Sema.HasCircularRawValueRequest 11,242 11,242 0 0.0%
Sema.HasDefaultInitRequest 41,401 41,401 0 0.0%
Sema.HasDynamicCallableAttributeRequest 11,732 11,732 0 0.0%
Sema.HasDynamicMemberLookupAttributeRequest 138,194 138,194 0 0.0%
Sema.HasImportsMatchingFlagRequest 65,137 65,137 0 0.0%
Sema.HasIsolatedSelfRequest 4,061,693 4,061,693 0 0.0%
Sema.HasMemberwiseInitRequest 17,376 17,376 0 0.0%
Sema.HasMissingDesignatedInitializersRequest 20,517 20,517 0 0.0%
Sema.HasSelfOrAssociatedTypeRequirementsRequest 8,345 8,345 0 0.0%
Sema.HasUserDefinedDesignatedInitRequest 41,401 41,401 0 0.0%
Sema.IDEInspectionFileRequest 0 0 0 0.0%
Sema.InferredGenericSignatureRequest 94,291 94,291 0 0.0%
Sema.InheritedDeclsReferencedRequest 1,132,894 1,132,894 0 0.0%
Sema.InheritedProtocolsRequest 117,240 117,240 0 0.0%
Sema.InheritedTypeRequest 219,204 219,204 0 0.0%
Sema.InheritsSuperclassInitializersRequest 19,289 19,289 0 0.0%
Sema.InitKindRequest 78,016 78,016 0 0.0%
Sema.InterfaceTypeRequest 4,648,305 4,648,305 0 0.0%
Sema.IsABICompatibleOverrideRequest 171,094 171,094 0 0.0%
Sema.IsAccessorTransparentRequest 302,356 302,356 0 0.0%
Sema.IsActorRequest 373,757 373,757 0 0.0%
Sema.IsCallAsFunctionNominalRequest 5,940 5,940 0 0.0%
Sema.IsDeclApplicableRequest 0 0 0 0.0%
Sema.IsDeclRefinementOfRequest 33,056 33,056 0 0.0%
Sema.IsDefaultActorRequest 31,963 31,963 0 0.0%
Sema.IsDistributedActorRequest 428,431 428,431 0 0.0%
Sema.IsDynamicRequest 1,554,042 1,554,042 0 0.0%
Sema.IsFinalRequest 1,287,756 1,287,756 0 0.0%
Sema.IsGetterMutatingRequest 410,015 410,015 0 0.0%
Sema.IsImplicitlyUnwrappedOptionalRequest 2,305,693 2,305,693 0 0.0%
Sema.IsMoveOnlyRequest 219,273 219,273 0 0.0%
Sema.IsNonUserModuleRequest 282 282 0 0.0%
Sema.IsObjCRequest 1,390,848 1,390,848 0 0.0%
Sema.IsSafeUseOfCxxDecl 0 0 0 0.0%
Sema.IsSetterMutatingRequest 398,642 398,642 0 0.0%
Sema.IsSingleValueStmtRequest 288,873 288,873 0 0.0%
Sema.IsStaticRequest 696,294 696,294 0 0.0%
Sema.LazyStoragePropertyRequest 577 577 0 0.0%
Sema.LocalDiscriminatorsRequest 341,107 341,107 0 0.0%
Sema.LookupAllConformancesInContextRequest 148,837 148,837 0 0.0%
Sema.LookupConformanceInModuleRequest 76,787,903 76,796,076 8,172 0.01%
Sema.LookupInModuleRequest 3,477,138 3,477,138 0 0.0%
Sema.LookupInfixOperatorRequest 63,054 63,054 0 0.0%
Sema.LookupPostfixOperatorRequest 37 37 0 0.0%
Sema.LookupPrecedenceGroupRequest 27,583 27,583 0 0.0%
Sema.LookupPrefixOperatorRequest 211 211 0 0.0%
Sema.MacroDefinitionRequest 0 0 0 0.0%
Sema.MangleLocalTypeDeclRequest 276 276 0 0.0%
Sema.ModuleImplicitImportsRequest 1,262 1,262 0 0.0%
Sema.ModuleLibraryLevelRequest 107 107 0 0.0%
Sema.ModuleQualifiedLookupRequest 606,859 606,859 0 0.0%
Sema.NamedLazyMemberLoadSuccessCount 11,307,773 11,307,773 0 0.0%
Sema.NamingPatternRequest 38,922 38,922 0 0.0%
Sema.NeedsNewVTableEntryRequest 666,909 666,909 0 0.0%
Sema.NumAccessorBodiesSynthesized 254,904 254,904 0 0.0%
Sema.NumAccessorsSynthesized 257,985 257,985 0 0.0%
Sema.NumConformancePathsRecorded 791,814 791,814 0 0.0%
Sema.NumConformancesDeserialized 781,183 781,183 0 0.0%
Sema.NumConstraintScopes 48,778,704 48,778,702 -2 -0.0%
Sema.NumConstraintsConsideredForEdgeContraction 2,198,024 2,198,024 0 0.0%
Sema.NumCrossImportsChecked 0 0 0 0.0%
Sema.NumCrossImportsFound 0 0 0 0.0%
Sema.NumCyclicOneWayComponentsCollapsed 0 0 0 0.0%
Sema.NumDeclsDeserialized 15,276,932 15,276,932 0 0.0%
Sema.NumDeclsTypechecked 1,781,517 1,781,517 0 0.0%
Sema.NumLazyIterableDeclContexts 2,034,546 2,034,546 0 0.0%
Sema.NumLazyRequirementSignatures 146,366 146,366 0 0.0%
Sema.NumLazyRequirementSignaturesLoaded 106,212 106,212 0 0.0%
Sema.NumLeafScopes 37,293,918 37,293,917 -1 -0.0%
Sema.NumRequirementMachineCompletionSteps 4,348,102 4,348,102 0 0.0%
Sema.NumRequirementMachineUnifiedConcreteTerms 325,495 325,495 0 0.0%
Sema.NumRequirementMachines 369,673 369,673 0 0.0%
Sema.NumTypesDeserialized 6,188,091 6,188,091 0 0.0%
Sema.NumUnloadedLazyIterableDeclContexts 1,228,832 1,228,832 0 0.0%
Sema.ObjCInterfaceAndImplementationRequest 549,521 549,521 0 0.0%
Sema.OpaqueReadOwnershipRequest 222,842 222,842 0 0.0%
Sema.OpaqueResultTypeRequest 242 242 0 0.0%
Sema.OperatorPrecedenceGroupRequest 448 448 0 0.0%
Sema.OverriddenDeclsRequest 1,572,342 1,572,342 0 0.0%
Sema.ParamSpecifierRequest 1,001,202 1,001,202 0 0.0%
Sema.PatternBindingEntryRequest 357,060 357,060 0 0.0%
Sema.PatternTypeRequest 463,602 463,602 0 0.0%
Sema.PolymorphicEffectKindRequest 580,997 580,997 0 0.0%
Sema.PolymorphicEffectRequirementsRequest 31 31 0 0.0%
Sema.PreCheckResultBuilderRequest 569 569 0 0.0%
Sema.PreCheckReturnStmtRequest 466,055 466,055 0 0.0%
Sema.PrimaryAssociatedTypesRequest 7,745 7,745 0 0.0%
Sema.PrimarySourceFilesRequest 1,262 1,262 0 0.0%
Sema.PropertyWrapperAuxiliaryVariablesRequest 1,554,783 1,554,783 0 0.0%
Sema.PropertyWrapperBackingPropertyTypeRequest 9,233 9,233 0 0.0%
Sema.PropertyWrapperInitializerInfoRequest 397,792 397,792 0 0.0%
Sema.PropertyWrapperLValuenessRequest 737 737 0 0.0%
Sema.PropertyWrapperMutabilityRequest 407,837 407,837 0 0.0%
Sema.PropertyWrapperTypeInfoRequest 123 123 0 0.0%
Sema.ProtocolDependenciesRequest 96,604 96,604 0 0.0%
Sema.ProtocolRequirementsRequest 19,159 19,159 0 0.0%
Sema.ProtocolRequiresClassRequest 9,564 9,564 0 0.0%
Sema.ProvideDefaultImplForRequest 20,724 20,724 0 0.0%
Sema.QualifiedLookupRequest 4,745,178 4,745,178 0 0.0%
Sema.RangeInfoRequest 0 0 0 0.0%
Sema.RawCommentRequest 575,996 575,996 0 0.0%
Sema.RenamedDeclRequest 3,060 3,060 0 0.0%
Sema.RequirementRequest 95,924 95,924 0 0.0%
Sema.RequirementSignatureRequest 117,198 117,198 0 0.0%
Sema.RequiresOpaqueAccessorsRequest 1,406,567 1,406,567 0 0.0%
Sema.RequiresOpaqueModifyCoroutineRequest 222,829 222,829 0 0.0%
Sema.ResolveEffectiveMemberwiseInitRequest 0 0 0 0.0%
Sema.ResolveImplicitMemberRequest 482,395 482,395 0 0.0%
Sema.ResolveMacroRequest 13,048 13,048 0 0.0%
Sema.ResolveProtocolNameRequest 0 0 0 0.0%
Sema.ResolveTypeEraserTypeRequest 0 0 0 0.0%
Sema.ResolveTypeRequest 2,506,898 2,506,898 0 0.0%
Sema.ResultBuilderTypeRequest 388,834 388,834 0 0.0%
Sema.ResultTypeRequest 513,764 513,764 0 0.0%
Sema.RootAndResultTypeOfKeypathDynamicMemberRequest 0 0 0 0.0%
Sema.RootTypeOfKeypathDynamicMemberRequest 0 0 0 0.0%
Sema.SPIGroupsRequest 2,310,146 2,310,146 0 0.0%
Sema.ScopedImportLookupRequest 449 449 0 0.0%
Sema.SelfAccessKindRequest 383,787 383,787 0 0.0%
Sema.SelfBoundsFromGenericSignatureRequest 31,029 31,029 0 0.0%
Sema.SelfBoundsFromWhereClauseRequest 531,151 531,151 0 0.0%
Sema.SemanticAvailableRangeAttrRequest 3,943 3,943 0 0.0%
Sema.SemanticBriefCommentRequest 183,118 183,118 0 0.0%
Sema.SemanticUnavailableAttrRequest 1,199,566 1,199,566 0 0.0%
Sema.SetterAccessLevelRequest 185,120 185,120 0 0.0%
Sema.SimpleDidSetRequest 412,118 412,118 0 0.0%
Sema.SpecializeAttrTargetDeclRequest 1,607 1,607 0 0.0%
Sema.StorageImplInfoRequest 1,560,475 1,560,475 0 0.0%
Sema.StoredPropertiesAndMissingMembersRequest 44,446 44,446 0 0.0%
Sema.StoredPropertiesRequest 143,564 143,564 0 0.0%
Sema.StructuralRequirementsRequest 11,004 11,004 0 0.0%
Sema.StructuralTypeRequest 608 608 0 0.0%
Sema.SuperclassDeclRequest 108,034 108,034 0 0.0%
Sema.SuperclassTypeRequest 30,369 30,369 0 0.0%
Sema.SynthesizeAccessorRequest 257,985 257,985 0 0.0%
Sema.SynthesizeDefaultInitRequest 3,385 3,385 0 0.0%
Sema.SynthesizeMainFunctionRequest 124,428 124,428 0 0.0%
Sema.SynthesizeMemberwiseInitRequest 3,373 3,373 0 0.0%
Sema.SynthesizeRuntimeMetadataAttrGenerator 0 0 0 0.0%
Sema.SynthesizeRuntimeMetadataAttrGeneratorBody 0 0 0 0.0%
Sema.TangentStoredPropertyRequest 0 0 0 0.0%
Sema.TypeAliasRequirementsRequest 11,004 11,004 0 0.0%
Sema.TypeCheckASTNodeAtLocRequest 0 0 0 0.0%
Sema.TypeCheckFunctionBodyRequest 643,791 643,791 0 0.0%
Sema.TypeCheckObjCImplementationRequest 0 0 0 0.0%
Sema.TypeCheckSourceFileRequest 32,762 32,762 0 0.0%
Sema.TypeDeclsFromWhereClauseRequest 33,002 33,002 0 0.0%
Sema.TypeEraserHasViableInitRequest 0 0 0 0.0%
Sema.TypeRelationCheckRequest 0 0 0 0.0%
Sema.TypeWitnessRequest 5,412 5,412 0 0.0%
Sema.USRGenerationRequest 442,694 442,694 0 0.0%
Sema.UnderlyingTypeDeclsReferencedRequest 57,267 57,267 0 0.0%
Sema.UnderlyingTypeRequest 28,645 28,645 0 0.0%
Sema.UnqualifiedLookupRequest 3,445,410 3,445,410 0 0.0%
Sema.ValidatePrecedenceGroupRequest 214,559 214,559 0 0.0%
Sema.ValueWitnessRequest 35,546 35,546 0 0.0%
TBDGen.APIGenRequest 0 0 0 0.0%
TBDGen.GenerateTBDRequest 0 0 0 0.0%
TBDGen.PublicSymbolsRequest 1,208 1,208 0 0.0%
TBDGen.SymbolSourceMapRequest 0 0 0 0.0%

@hamishknight hamishknight force-pushed the you-shall-not-parse branch 2 times, most recently from 4316a7a to 6d81466 Compare May 22, 2023 13:30
@hamishknight
Copy link
Contributor Author

Decided to remove the ASTGen enablement flags from the parsing options as we weren't taking advantage of customizing them per SourceFile, so keeping them on LangOptions seems fine. I expect we'll have fixed the performance issues with the new parser before we ever flip ASTGen on by default.

@hamishknight
Copy link
Contributor Author

Is there a way we can set up the diagnostic printer to use this, too? We end up reparsing when printing diagnostics, which seems a bit ridiculous, but the layering is unfortunate.

@DougGregor Yeah that's unfortunate. I took a quick look at this, and it looks like we'll need to find a way to thread the ASTContext through to the printing logic, which doesn't seem entirely trivial, so I'm going to leave that as future work for now.

This matches the behavior of `printAlwaysOnStatsAndTimers`,
which we use in a release build. This fixes the
diverging behavior, and ensures process-stats-dir
can handle comparing deltas between runs where
one of the runs had a 0 counter.
Avoid parsing the syntax tree up-front, and instead
only parse it when required, which happens when either:

1. ASTGen parsing is enabled (currently disabled
   by default)
2. Round trip checking is enabled for a primary
   file (enabled by default in a debug build,
   except when dep scanning or doing an IDE
   operation)
3. We need to evaluate a macro in that file

This change therefore means that we now no longer
need to parse the syntax tree for secondary files
by default unless we specifically need to evaluate
a macro in them (e.g if we need to lookup a member
on a decl with an attached macro). And the same
for primaries in release builds.

rdar://109283847
@hamishknight hamishknight force-pushed the you-shall-not-parse branch from 6d81466 to 58d6694 Compare May 22, 2023 13:55
@hamishknight
Copy link
Contributor Author

@swift-ci please test

@DougGregor
Copy link
Member

Is there a way we can set up the diagnostic printer to use this, too? We end up reparsing when printing diagnostics, which seems a bit ridiculous, but the layering is unfortunate.

@DougGregor Yeah that's unfortunate. I took a quick look at this, and it looks like we'll need to find a way to thread the ASTContext through to the printing logic, which doesn't seem entirely trivial, so I'm going to leave that as future work for now.

Or something other than ASTContext. The parser doesn't actually have different behavior based on language options, so in theory we could share the syntax trees across multiple ASTContext instances.

@hamishknight
Copy link
Contributor Author

hamishknight commented May 22, 2023

Yeah that's a good point, we'd still need to find a way to thread the Evaluator through tho

@hamishknight hamishknight merged commit 9678946 into swiftlang:main May 22, 2023
@hamishknight hamishknight deleted the you-shall-not-parse branch May 22, 2023 19:16
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