Skip to content

[stdlib] Switch ManagedBuffer.header to use _modify #19226

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

First go at trying this with a property rather than a subscript...

@airspeedswift
Copy link
Member Author

@swift-ci please smoke benchmark

@airspeedswift
Copy link
Member Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build comment file:

Performance: -O

TEST OLD NEW DELTA SPEEDUP
Improvement
IterateData 1738 1566 -9.9% 1.11x
RandomDoubleLCG 2171 2028 -6.6% 1.07x

Performance: -Osize

TEST OLD NEW DELTA SPEEDUP
Improvement
IterateData 1750 1632 -6.7% 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

@lancep lancep self-requested a review September 10, 2018 23:16
Copy link
Contributor

@lancep lancep left a comment

Choose a reason for hiding this comment

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

Looks good!

@airspeedswift
Copy link
Member Author

@swift-ci please smoke test compiler performance

@moiseev
Copy link
Contributor

moiseev commented Sep 10, 2018

YOLO!

@swift-ci
Copy link
Contributor

Build comment file:

Compilation-performance test failed

@airspeedswift
Copy link
Member Author

@swift-ci please test compiler performance

@swift-ci
Copy link
Contributor

Build comment file:

Compilation-performance test failed

@airspeedswift
Copy link
Member Author

@swift-ci please smoke test compiler performance

@swift-ci
Copy link
Contributor

Build comment file:

Summary for master smoketest

Unexpected test results, excluded stats for Kingfisher, ReactiveCocoa

Regressions found (see below)

Debug

debug brief

Regressed (1)
name old new delta delta_pct
time.swift-driver.wall 23.1s 23.3s 240.7ms 1.04% ⛔
Improved (0)
name old new delta delta_pct
Unchanged (delta < 1.0% or delta < 100.0ms) (2)
name old new delta delta_pct
Frontend.NumInstructionsExecuted 218,588,627,823 218,747,671,761 159,043,938 0.07%
LLVM.NumLLVMBytesOutput 9,451,772 9,451,772 0 0.0%

debug 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 5,848 5,848 0 0.0%
AST.NumLoadedModules 1,281 1,281 0 0.0%
AST.NumTotalClangImportedEntities 17,993 17,993 0 0.0%
AST.NumUsedConformances 1,344 1,344 0 0.0%
IRModule.NumIRBasicBlocks 31,484 31,484 0 0.0%
IRModule.NumIRFunctions 16,822 16,822 0 0.0%
IRModule.NumIRGlobals 14,378 14,378 0 0.0%
IRModule.NumIRInsts 440,416 440,416 0 0.0%
IRModule.NumIRValueSymbols 29,879 29,879 0 0.0%
LLVM.NumLLVMBytesOutput 9,451,772 9,451,772 0 0.0%
SILModule.NumSILGenFunctions 7,911 7,911 0 0.0%
SILModule.NumSILOptFunctions 10,717 10,717 0 0.0%
Sema.NumConformancesDeserialized 31,571 31,571 0 0.0%
Sema.NumConstraintScopes 71,146 71,146 0 0.0%
Sema.NumDeclsDeserialized 256,112 256,110 -2 -0.0%
Sema.NumDeclsValidated 16,273 16,273 0 0.0%
Sema.NumFunctionsTypechecked 7,047 7,047 0 0.0%
Sema.NumGenericSignatureBuilders 10,877 10,877 0 0.0%
Sema.NumLazyGenericEnvironments 50,393 50,393 0 0.0%
Sema.NumLazyGenericEnvironmentsLoaded 5,778 5,778 0 0.0%
Sema.NumLazyIterableDeclContexts 40,996 40,996 0 0.0%
Sema.NumTypesDeserialized 116,041 116,039 -2 -0.0%
Sema.NumTypesValidated 13,937 13,937 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 230,636,496,838 230,772,880,707 136,383,869 0.06%
LLVM.NumLLVMBytesOutput 10,527,132 10,544,976 17,844 0.17%
time.swift-driver.wall 38.7s 38.6s -81.1ms -0.21%

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 1,385 1,385 0 0.0%
AST.NumLoadedModules 100 100 0 0.0%
AST.NumTotalClangImportedEntities 4,901 4,901 0 0.0%
AST.NumUsedConformances 1,346 1,346 0 0.0%
IRModule.NumIRBasicBlocks 34,321 34,363 42 0.12%
IRModule.NumIRFunctions 15,068 15,120 52 0.35%
IRModule.NumIRGlobals 13,758 13,796 38 0.28%
IRModule.NumIRInsts 334,979 335,129 150 0.04%
IRModule.NumIRValueSymbols 27,725 27,815 90 0.32%
LLVM.NumLLVMBytesOutput 10,527,132 10,544,976 17,844 0.17%
SILModule.NumSILGenFunctions 6,138 6,138 0 0.0%
SILModule.NumSILOptFunctions 9,104 9,104 0 0.0%
Sema.NumConformancesDeserialized 16,584 16,584 0 0.0%
Sema.NumConstraintScopes 69,710 69,710 0 0.0%
Sema.NumDeclsDeserialized 52,007 52,002 -5 -0.01%
Sema.NumDeclsValidated 10,362 10,362 0 0.0%
Sema.NumFunctionsTypechecked 4,362 4,362 0 0.0%
Sema.NumGenericSignatureBuilders 2,585 2,585 0 0.0%
Sema.NumLazyGenericEnvironments 9,461 9,461 0 0.0%
Sema.NumLazyGenericEnvironmentsLoaded 1,312 1,312 0 0.0%
Sema.NumLazyIterableDeclContexts 5,811 5,811 0 0.0%
Sema.NumTypesDeserialized 30,810 30,805 -5 -0.02%
Sema.NumTypesValidated 7,103 7,103 0 0.0%

@airspeedswift
Copy link
Member Author

@swift-ci please test compiler performance

@swift-ci
Copy link
Contributor

Build comment file:

Summary for master full

Unexpected test results, excluded stats for RxSwift, ChattoAdditions, Wordy, 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 13,713,109,124,470 13,714,166,533,892 1,057,409,422 0.01%
LLVM.NumLLVMBytesOutput 494,086,472 494,057,416 -29,056 -0.01%
time.swift-driver.wall 1345.3s 1341.0s -4.3s -0.32%

debug-batch detailed

Regressed (0)
name old new delta delta_pct
Improved (2)
name old new delta delta_pct
Driver.NumDriverPipePolls 219,176 214,960 -4,216 -1.92% ✅
Driver.NumDriverPipeReads 237,441 234,110 -3,331 -1.4% ✅
Unchanged (delta < 1.0% or delta < 100.0ms) (92)
name old new delta delta_pct
AST.NumASTBytesAllocated 14,623,870,668 14,624,525,348 654,680 0.0%
AST.NumDecls 33,401 33,401 0 0.0%
AST.NumDependencies 90,765 90,765 0 0.0%
AST.NumImportedExternalDefinitions 772,120 772,120 0 0.0%
AST.NumInfixOperators 13,113 13,113 0 0.0%
AST.NumLinkLibraries 0 0 0 0.0%
AST.NumLoadedModules 103,611 103,611 0 0.0%
AST.NumLocalTypeDecls 111 111 0 0.0%
AST.NumObjCMethods 12,397 12,397 0 0.0%
AST.NumPostfixOperators 14 14 0 0.0%
AST.NumPrecedenceGroups 6,932 6,932 0 0.0%
AST.NumPrefixOperators 60 60 0 0.0%
AST.NumReferencedDynamicNames 101 101 0 0.0%
AST.NumReferencedMemberNames 1,813,727 1,813,727 0 0.0%
AST.NumReferencedTopLevelNames 115,653 115,653 0 0.0%
AST.NumSourceBuffers 153,218 153,217 -1 -0.0%
AST.NumSourceLines 1,193,359 1,193,359 0 0.0%
AST.NumSourceLinesPerSecond 540,113 539,787 -326 -0.06%
AST.NumTotalClangImportedEntities 2,541,148 2,541,148 0 0.0%
AST.NumUsedConformances 101,130 101,130 0 0.0%
Driver.ChildrenMaxRSS 37,526,351,872 37,539,289,088 12,937,216 0.03%
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 7,171 7,171 0 0.0%
Driver.NumDriverJobsSkipped 0 0 0 0.0%
Driver.NumProcessFailures 0 0 0 0.0%
Frontend.MaxMallocUsage 223,032,183,616 223,118,564,192 86,380,576 0.04%
Frontend.NumInstructionsExecuted 13,713,109,124,470 13,714,166,533,892 1,057,409,422 0.01%
Frontend.NumProcessFailures 0 0 0 0.0%
IRModule.NumIRAliases 59,044 59,044 0 0.0%
IRModule.NumIRBasicBlocks 1,746,996 1,746,993 -3 -0.0%
IRModule.NumIRComdatSymbols 0 0 0 0.0%
IRModule.NumIRFunctions 927,093 927,091 -2 -0.0%
IRModule.NumIRGlobals 1,119,344 1,119,344 0 0.0%
IRModule.NumIRIFuncs 0 0 0 0.0%
IRModule.NumIRInsts 20,140,588 20,139,683 -905 -0.0%
IRModule.NumIRNamedMetaData 35,398 35,398 0 0.0%
IRModule.NumIRValueSymbols 1,814,715 1,814,713 -2 -0.0%
LLVM.NumLLVMBytesOutput 494,086,472 494,057,416 -29,056 -0.01%
Parse.NumFunctionsParsed 648,696 648,696 0 0.0%
Parse.NumIterableDeclContextParsed 395,680 395,680 0 0.0%
SILModule.NumSILGenDefaultWitnessTables 0 0 0 0.0%
SILModule.NumSILGenFunctions 841,304 841,304 0 0.0%
SILModule.NumSILGenGlobalVariables 15,099 15,099 0 0.0%
SILModule.NumSILGenVtables 3,778 3,778 0 0.0%
SILModule.NumSILGenWitnessTables 18,544 18,544 0 0.0%
SILModule.NumSILOptDefaultWitnessTables 0 0 0 0.0%
SILModule.NumSILOptFunctions 671,440 671,440 0 0.0%
SILModule.NumSILOptGlobalVariables 15,511 15,511 0 0.0%
SILModule.NumSILOptVtables 7,244 7,244 0 0.0%
SILModule.NumSILOptWitnessTables 36,437 36,437 0 0.0%
Sema.AccessLevelRequest 887,671 887,671 0 0.0%
Sema.DefaultAndMaxAccessLevelRequest 22,126 22,126 0 0.0%
Sema.EnumRawTypeRequest 7,723 7,723 0 0.0%
Sema.ExtendedNominalRequest 1,496,980 1,496,980 0 0.0%
Sema.InheritedDeclsReferencedRequest 52,715,624 52,715,624 0 0.0%
Sema.InheritedTypeRequest 370,295 370,295 0 0.0%
Sema.IsDynamicRequest 789,470 789,470 0 0.0%
Sema.IsObjCRequest 651,236 651,236 0 0.0%
Sema.NamedLazyMemberLoadFailureCount 14,102 14,102 0 0.0%
Sema.NamedLazyMemberLoadSuccessCount 2,295,267 2,295,267 0 0.0%
Sema.NominalTypeLookupDirectCount 15,153,754 15,153,752 -2 -0.0%
Sema.NumConformancesDeserialized 1,965,561 1,965,561 0 0.0%
Sema.NumConstraintScopes 7,333,472 7,333,472 0 0.0%
Sema.NumConstraintsConsideredForEdgeContraction 13,269,916 13,269,916 0 0.0%
Sema.NumDeclsDeserialized 16,263,916 16,266,578 2,662 0.02%
Sema.NumDeclsValidated 891,574 891,574 0 0.0%
Sema.NumFunctionsTypechecked 644,524 644,524 0 0.0%
Sema.NumGenericSignatureBuilders 776,346 776,346 0 0.0%
Sema.NumLazyGenericEnvironments 3,146,511 3,146,533 22 0.0%
Sema.NumLazyGenericEnvironmentsLoaded 297,912 297,913 1 0.0%
Sema.NumLazyIterableDeclContexts 2,904,179 2,904,179 0 0.0%
Sema.NumTypesDeserialized 7,152,343 7,154,123 1,780 0.02%
Sema.NumTypesValidated 608,716 608,716 0 0.0%
Sema.NumUnloadedLazyIterableDeclContexts 2,012,758 2,012,757 -1 -0.0%
Sema.OverriddenDeclsRequest 708,928 708,928 0 0.0%
Sema.RequirementRequest 20,090 20,090 0 0.0%
Sema.SelfBoundsFromWhereClauseRequest 52,828 52,828 0 0.0%
Sema.SetterAccessLevelRequest 41,551 41,551 0 0.0%
Sema.SuperclassDeclRequest 41,797,264 41,797,264 0 0.0%
Sema.SuperclassTypeRequest 14,672 14,672 0 0.0%
Sema.TypeDeclsFromWhereClauseRequest 11,135 11,135 0 0.0%
Sema.USRGenerationRequest 175,720 175,720 0 0.0%
Sema.UnderlyingTypeDeclsReferencedRequest 1,560,357 1,560,357 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 13,041,921,276,536 13,039,489,489,485 -2,431,787,051 -0.02%
LLVM.NumLLVMBytesOutput 476,453,056 475,342,030 -1,111,026 -0.23%
time.swift-driver.wall 2490.0s 2487.2s -2.8s -0.11%

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 140,898 140,898 0 0.0%
AST.NumLoadedModules 6,613 6,613 0 0.0%
AST.NumTotalClangImportedEntities 462,731 462,731 0 0.0%
AST.NumUsedConformances 104,005 104,005 0 0.0%
IRModule.NumIRBasicBlocks 1,720,263 1,720,232 -31 -0.0%
IRModule.NumIRFunctions 763,266 763,256 -10 -0.0%
IRModule.NumIRGlobals 880,590 880,590 0 0.0%
IRModule.NumIRInsts 14,792,616 14,767,493 -25,123 -0.17%
IRModule.NumIRValueSymbols 1,517,028 1,517,018 -10 -0.0%
LLVM.NumLLVMBytesOutput 476,453,056 475,342,030 -1,111,026 -0.23%
SILModule.NumSILGenFunctions 322,880 322,880 0 0.0%
SILModule.NumSILOptFunctions 447,084 447,083 -1 -0.0%
Sema.NumConformancesDeserialized 953,299 953,299 0 0.0%
Sema.NumConstraintScopes 7,254,445 7,254,445 0 0.0%
Sema.NumDeclsDeserialized 2,913,921 2,914,330 409 0.01%
Sema.NumDeclsValidated 417,299 417,299 0 0.0%
Sema.NumFunctionsTypechecked 262,074 262,074 0 0.0%
Sema.NumGenericSignatureBuilders 114,682 114,682 0 0.0%
Sema.NumLazyGenericEnvironments 510,873 510,825 -48 -0.01%
Sema.NumLazyGenericEnvironmentsLoaded 58,012 58,012 0 0.0%
Sema.NumLazyIterableDeclContexts 341,821 341,821 0 0.0%
Sema.NumTypesDeserialized 1,660,390 1,660,608 218 0.01%
Sema.NumTypesValidated 187,234 187,234 0 0.0%

@airspeedswift
Copy link
Member Author

I think the wall time regression on the smoke compiler bench was noise.

@airspeedswift airspeedswift merged commit d414ece into swiftlang:master Sep 12, 2018
@airspeedswift airspeedswift deleted the managedbuffer-yield-head branch September 12, 2018 00:40
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.

4 participants