I've found a lot information in internet about this, but I can't answer for myself; will .net 4.0 application work slower if I add .net 3.5/2.0 assembly, and should I recompile them in 4.0 if I can?
Asked
Active
Viewed 185 times
1
-
possible duplicate of [.NET 4.0 project reference 2.0 assembly](http://stackoverflow.com/questions/2455654/net-4-0-project-reference-2-0-assembly) – Randolpho May 24 '10 at 15:15
-
@Randolpho: Not even close to being a duplicate. – Robert Harvey May 24 '10 at 15:18
-
Don't worry about micro-optimization. The only time you should really worry about optimizations like this is after it is written and you know it is a problem. – Stephan May 24 '10 at 15:34
-
1@Robert Harvey: You're right; I regretted that almost immediately, but I can't undo it. :) – Randolpho May 24 '10 at 16:57
1 Answers
1
I don't think you should worry about performance in this scenario. The 2.0/3.5 assemblies may actually work faster, since there is potentially less code overhead (in some rare cases).
But that's all micro-optimization anyway, and the only way you're going to know for sure is to profile your code, and see how fast it really is. I think you're going to find in the vast majority of cases that it isn't going to matter.

Robert Harvey
- 178,213
- 47
- 333
- 501
-
Yes, but dzen will be lost :) So there is no difference between refferencing 4.0 or earlier assemblies, is there? Will two runtimes be loaded or not? (Just assemblies, not com-objects) – er-v May 24 '10 at 16:54