tags:

views:

141

answers:

5

Hi,

Does using Multiple .NET Languages (Delphi, VB.NET, C#) into the same application (but in differents class library of course) can down peformances compared to a full C# application for example ?

+2  A: 

Without any hard evidence to prove this, I am going to just make an educated guess and say no. Since your assemblies get compiled down to almost identical IL, you really aren't going to see any performance degradation from using different implementations of a CLR language.

Josh
But this is with single restriction that the compilation different dotnet languages to MSIL is the same. I mean different compilers act the same.
Ahmed Said
+4  A: 

I'm not an expert on the CLR, but I would guess that you will have very similar performance. All the languages compile to MSIL which runs on the CLR. There could be differences in performance depending on the MSIL generated from the compilers. i.e. It's possible that similar code in VB.NET would compile to less (or more) optimized MSIL than the C# compiler.

Lance Fisher
Agreed. In some cases it might actually be beneficial to use the language that will best solve the problem set of a particular sub-system. For instance using F# for a highly parallel computational program.
Josh
True. Worth a +1.
Martinho Fernandes
+3  A: 

Although I don't have any benchmarks off hand, I would say that for the most part it shouldn't. Those different languages all compile the code into CIL, so you should be fine.

One place where this would be different is with the languages that are run on the DLR (IronPython, IronRuby, etc.). They're compiling in the use of some features that aren't present in the CLR and that are more costly operations.

commondream
+1  A: 

As has been mentioned by the other answers, all the code ends up compiling down to CIL, so provided the code is done consistently across languages (and you don't have compiler optimizations enabled) the resulting IL will come out pretty identical. Now if you have the same code and make use of compiler optimizations you could wind up with a differing set of IL that would have an affect on performance.

As was brought up by this answer, the DLR could have an effect on performance. Most of what I've heard/read about it though stated the performance impact is mostly negligible.

Agent_9191
A: 

I agree with the other answers. The only thing that could affect performance is that if you're loading many assemblies, you will see an overhead. However the overhead is not related to the language used to create the assembly, but if you mix a lot of different components you may end up with more assemblies than otherwise. If that is not the case for your application, you should be fine afaik.

Brian Rasmussen