When profiling the memory usage for https://github.com/dotnet/linker/issues/3126, I found there are about twice as many instances of ParameterDefinitionCollection as MethodDefinition, which doesn't seem to make sense if a MethodDefinition should have a single ParameterDefinitionCollection. They are taking a significant amount of memory in the heap, so it would be beneficial to be able to remove any duplicates we have.
When profiling the memory usage for https://github.com/dotnet/linker/issues/3126, I found there are about twice as many instances of ParameterDefinitionCollection as MethodDefinition, which doesn't seem to make sense if a MethodDefinition should have a single ParameterDefinitionCollection. They are taking a significant amount of memory in the heap, so it would be beneficial to be able to remove any duplicates we have.