You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ILReader is still somewhat expensive when resolving method references.
TypeProvider.GetTypeFromReference() still constructs a GetClassTypeReference and IModuleReference. These are unnecessary allocations and should be refactored away. Moreover, assemblies tend to have only few module references, so it's highly useful to cache the result of resolving them within the MetadataAssembly.
We currently fully resolve the signature of a memberref into type objects; then use them only for comparing the type objects against the available methods. It's possible to directly compare the signature bytes instead (SignatureBlobComparer). This might speed things up (though it might also cause us to resolve types slightly more often).
Also, SignatureBlobComparer.TypeHandleEquals needs adjustment. The current implementation is both inefficient (allocates strings, splits of backticks for generics), and ignores the assembly identity.
We might consider reintroducing caches for resolving typerefs and/or memberrefs (we had those in ILSpy 3.x). But let's first try to optimize the other ways; a fast robust IEntity<->memberref comparison will also help analyzer performance.
The text was updated successfully, but these errors were encountered:
…type system.
We now avoid the old `IModuleReference` interface which required allocating for every type being resolved.
Instead `MetadataModule.ResolveModule` now combines decoding+resolving assembly references into a single step.
This allows the type system to maintain a cache indexed by row number.
This also changes the behavior of resolving references within a compilation: We now prefer an exact match (name + version + publickeytoken) first; and fall back to a name-only match only if no exact match exists.
This somewhat improves the decompilation of assemblies created by using ilmerge to combine assemblies with different target frameworks.
ILReader is still somewhat expensive when resolving method references.
TypeProvider.GetTypeFromReference() still constructs a GetClassTypeReference and IModuleReference. These are unnecessary allocations and should be refactored away. Moreover, assemblies tend to have only few module references, so it's highly useful to cache the result of resolving them within the
MetadataAssembly
.We currently fully resolve the signature of a
memberref
into type objects; then use them only for comparing the type objects against the available methods. It's possible to directly compare the signature bytes instead (SignatureBlobComparer
). This might speed things up (though it might also cause us to resolve types slightly more often).Also,
SignatureBlobComparer.TypeHandleEquals
needs adjustment. The current implementation is both inefficient (allocates strings, splits of backticks for generics), and ignores the assembly identity.IEntity
<->memberref
comparison will also help analyzer performance.The text was updated successfully, but these errors were encountered: