Cache ConformanceAccessPaths in GSB::EquivalenceClass for big wins

This dramatically speeds up SubstitutionMap::lookupConformance,
shaving off 1/3 of the time spent compiling the standard library.
This commit is contained in:
Jordan Rose
2018-08-09 11:52:05 -07:00
parent 6a2c8bd07d
commit f8fd85b51b
2 changed files with 17 additions and 6 deletions

View File

@@ -22,6 +22,7 @@
#include "swift/AST/Decl.h"
#include "swift/AST/DiagnosticEngine.h"
#include "swift/AST/GenericSignature.h"
#include "swift/AST/Identifier.h"
#include "swift/AST/ProtocolConformanceRef.h"
#include "swift/AST/Types.h"
@@ -45,7 +46,6 @@ namespace swift {
class DeclContext;
class DependentMemberType;
class GenericParamList;
class GenericSignature;
class GenericSignatureBuilder;
class GenericTypeParamType;
class LazyResolver;
@@ -278,6 +278,10 @@ public:
/// Cached nested-type information, which contains the best declaration
/// for a given name.
llvm::SmallDenseMap<Identifier, CachedNestedType> nestedTypeNameCache;
/// Cached access paths.
llvm::SmallDenseMap<const ProtocolDecl *, ConformanceAccessPath, 8>
conformanceAccessPathCache;
};
friend class RequirementSource;