Caching ResourceManagerStringLocalizer creation#1864
Caching ResourceManagerStringLocalizer creation#1864sebastienros wants to merge 2 commits intomasterfrom
Conversation
|
@sebastienros Can you run a profile on this code so we can see the difference ? |
|
Did we ever get our profile proof? |
|
Note that some sources edited in this PR has migrated to dotnet/aspnetcore. A new PR with the same changes for the affected sources should be opened in dotnet/aspnetcore. See #2974 for details. |
|
As per aspnet/Announcements#411, we are currently migrating components from this repository to other repositories. This PR targets components that have been moved to dotnet/aspnetcore. If you're still interested in contributing this change, please retarget your PR to dotnet/aspnetcore and reference the original issue discussing the change or bug fix. If you have questions, or need guidance on how to port your change, please tag |
Fixes #1264
As per the issue details, the current code is doing too much reflection.
Here the
_localizerCacheis reused to add entries for theTypebased initialization. The keys can't collide with the other usage of the dictionary.AssemblyQualifiedNameis used as the key to isolate all types in the dictionary.