What, if any are the performance (or other) implications of creating a new .NET ResourceManager
on every request with new ResourceManger(myResourceType.FullName, myResourceType.Assembly)
vs using the "cached ResourceManager instance" in the .Designer.cs generated class (MyResourceType.ResourceManager
)?
I am working in the context of a ASP.NET MVC 3 application using .resx files.
Edit: I am interested in implications beyond the cost allocating memory for the new object.
Edit: Looking at 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 seems to imply that the initial opening of the resource set is expensive, which suggests to me that creating a new manager on each request could be expensive. However, the docs don't suggest a best practice with regard to the lifetime/scope of resource managers.