K2: Optimize AbstractFirDeserializedSymbolProvider
Avoid filling caches with keys that are definitely empty (if it's cheap to compute that), to decrease the size of backing maps. The strategy is pre-computing the sets of names that might be met. NB: the size of the sets is way fewer than a size of all queried names.
This commit is contained in:
committed by
Space Team
parent
e2e87bd107
commit
58c1b5dd1f
+5
@@ -94,6 +94,11 @@ class KlibBasedSymbolProvider(
|
||||
}
|
||||
}
|
||||
|
||||
override fun computePackageSetWithNonClassDeclarations(): Set<String> = fragmentNamesInLibraries.keys
|
||||
|
||||
// Looks like it's expensive to compute the presence of a class properly for KLib
|
||||
override fun mayHaveTopLevelClass(classId: ClassId): Boolean = true
|
||||
|
||||
@OptIn(SymbolInternals::class)
|
||||
override fun extractClassMetadata(classId: ClassId, parentContext: FirDeserializationContext?): ClassMetadataFindResult? {
|
||||
val packageStringName = classId.packageFqName.asString()
|
||||
|
||||
Reference in New Issue
Block a user