dotnet / linker

388 stars 127 forks source link

Use LinkContext caching when resolving ExportedTypes #3074

Closed jtschuster closed 1 year ago

jtschuster commented 1 year ago

Builds off of https://github.com/dotnet/linker/pull/3073.

Bans MethodReference.Resolve and ExportedType.Resolve and recommend LinkContext.Resolve instead.

Adds a cache on LinkContext for resolving ExportedTypes and replaces calls to Cecil's Resolve.

Replaces some calls to MethodReference.Resolve.

Together with https://github.com/dotnet/linker/pull/3073, performance improves to better than before the virtual method regression in August.

Trimmer CPU sec on ASP.Net benchmarks build: 27325 before the regression related to https://github.com/dotnet/linker/issues/3067 87310 in main 23520 after this change

jtschuster commented 1 year ago

Isolated the changes into https://github.com/dotnet/linker/pull/3075