Reduce RuntimeType.MakeGenericType overheads (#45137)
authorStephen Toub <stoub@microsoft.com>
Tue, 24 Nov 2020 12:03:10 +0000 (07:03 -0500)
committerGitHub <noreply@github.com>
Tue, 24 Nov 2020 12:03:10 +0000 (07:03 -0500)
commit664b96289bbcbb6abda6d2137e701c733f1a1094
tree9d4ce4793ca4a3fca5a3bdccfefd92ab35c34698
parentaebd598664e7d931eee19eb1779c0ace5d1c3600
Reduce RuntimeType.MakeGenericType overheads (#45137)

- Avoid an extra GetGenericArguments() call for all arities.
- Special-case a Type[] with just one type.  In looking at all calls to MakeGenericType when starting up a basic ASP.NET MVC app, 70% were for a single generic argument (the rest were for two).
src/coreclr/src/System.Private.CoreLib/src/System/RuntimeHandles.cs
src/coreclr/src/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs