What, if any, are the performance consequences (or others) of creating a new .NET ResourceManager
for each request using new ResourceManger(myResourceType.FullName, myResourceType.Assembly)
vs using the "cached instance of ResourceManager" in the generated class .Designer.cs ( MyResourceType.ResourceManager
)?
I work in the context of an ASP.NET MVC 3 application using .resx files.
Edit: I'm interested in consequences that go beyond allocating resources for a new facility.
Edit: By reviewing the MSDN documentation for ResourceManager.ReleaseAllResources
, it states that:
This method will shrink the working set in a running application. Any future resource lookups on this ResourceManager will be as extensive as the first lookup, since it will need to search and load resources again.
This, apparently, means that the initial discovery of a set of resources is expensive, which suggests that creating a new manager for each request can be expensive. However, the documents do not offer best practices regarding the lifetime / volume of resource managers.
source share