I'm very new to Unity and we're using Unity for plain old DI in a ASP.NET 3.5 web application.
Looking at the app in RedGate ANTS Profiler I'm seeing that the PolicyList.Set function (see below) is horribly inefficient.
/// Sets an individual policy.
/// <param name="policyInterface">The <see cref="Type"/> of the policy.</param>
/// <param name="policy">The policy to be registered.</param>
/// <param name="buildKey">The key the policy applies.</param>
public void Set(Type policyInterface,
Dictionary<PolicyKey, IBuilderPolicy> newPolicies = ClonePolicies(); // takes a huge amount of % time
newPolicies[new PolicyKey(policyInterface, buildKey)] = policy;
We are not using Policies (if I understand them correctly - and there's a good chance I don't) at all. Is there a config setting or code I can use to "disable" them? It would speed up my app ~70%!
Thanks in advance,
It seems you got the same issue like on this
thread. If this is not the case, then maybe you can post your relevant code here.
Noel Angelo Bolasoc