views:

85

answers:

1

I have two .NET libraries: "Foo.Bar" and "Foo.Baz".
"Foo.Bar" is self-contained, while "Foo.Baz" references "Foo.Bar".

Assuming I do the following:

  • Use ILMerge to merge "Foo.Bar.dll" with "Foo.Baz.dll" into "Foo1.dll".
  • Create a new solution containing the entirity of both "Foo.Bar" and "Foo.Baz" (since I have access to their source code), and compile this into "Foo2.dll".

Will there be any differences in the performance of Foo1.dll and Foo2.dll when using their functionality from an external project? If so, how significant is this performance difference, and is it a once-off (on load?) or ongoing difference? Are there any other advantages or disadvantages with either approach?

+2  A: 

I'm sure it wouldn't produce exactly the same IL, but it would be extremely close and I can't imagine any appreciable difference between the two methods. Other than the fact that the ILMerge method is probably more convenient and maintainable, I think both solutions would have the same outcome.

Josh Einstein
Why wouldn't it produce the exact same IL? Why would ILMerge have to emit new IL?
Matt Olenik
The bulk of the IL will be the same, but ILMerge does make some transformations. Some of it is configurable like merging type definitions. Some of it has to do with assembly-level attributes. I think it can change type visibility, etc.
Josh Einstein
None of which should affect the performance of the assembly, mind you.
Josh Einstein