Skip to content

Commit

Permalink
Assembly Resolver perf improvement (#1218)
Browse files Browse the repository at this point in the history
* Adding null in resolvedAssemblies dictionary for assemblies which couldnt be resolved.
It is giving ~3.1 seconds perf improvement for 10k xunit tests from vstest.console during execution.

* Removed extra white spaces

* PR comments

* PR comments
  • Loading branch information
Shyam-Gupta authored Oct 26, 2017
1 parent c483d36 commit 78d63ef
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/Microsoft.TestPlatform.Common/Utilities/AssemblyResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ private Assembly OnResolve(object sender, AssemblyResolveEventArgs args)
EqtTrace.Info("AssemblyResolver: {0}: Failed to create assemblyName. Reason:{1} ", args.Name, ex);
}

this.resolvedAssemblies[args.Name] = null;
return null;
}

Expand Down Expand Up @@ -175,9 +176,15 @@ private Assembly OnResolve(object sender, AssemblyResolveEventArgs args)
}
}
}
}

return null;
if (EqtTrace.IsInfoEnabled)
{
EqtTrace.Info("AssemblyResolver: {0}: Failed to load assembly.", args.Name);
}

this.resolvedAssemblies[args.Name] = null;
return null;
}
}

/// <summary>
Expand Down

0 comments on commit 78d63ef

Please sign in to comment.