dotnet / linker

388 stars 127 forks source link

Check for marking virtual method due to base only when state changes #3073

Closed jtschuster closed 1 year ago

jtschuster commented 1 year ago

Instead of checking every virtual method to see if it should be kept due to a base method every iteration of the MarkStep pipeline, check each method only when its relevant state has changed. These state changes are:

This required some changes to TypeMapInfo:

I profiled the ASP.Net benchmark's build link time and got the following time in CPU ms: 27325 before the regression related to https://github.com/dotnet/linker/issues/3067 87310 in main 32011 after this change

This also changes behavior in a couple places:

Closes https://github.com/dotnet/linker/issues/3067 Closes https://github.com/dotnet/linker/issues/3069

jtschuster commented 1 year ago

I rebased by mistake and the git history got messed up and duplicated a bunch of commits. The only real changes should be from 2bc88c0.