Compa Thread performance in C# and vb.net  
Author Message
danilomunoz





PostPosted: Visual C# General, Compa Thread performance in C# and vb.net Top

Hi!

Are there some difference thread performace in c# and vb.net

I have an app in vb.net with use some threads for imaging processing. So, it's some hard. I wanna know if a c# implementation would be better.

Thanks a lot.



Visual C#3  
 
 
Lepaca





PostPosted: Visual C# General, Compa Thread performance in C# and vb.net Top

VB and C# compile both in MSIL... then substantially is the same...

If you want better performances you have to use unmanaged code with C++ or assembler...


 
 
danilomunoz





PostPosted: Visual C# General, Compa Thread performance in C# and vb.net Top

Ok... but .. is the MSIL produced by c# more optimized than vb.net

Thanks again.


 
 
Lepaca





PostPosted: Visual C# General, Compa Thread performance in C# and vb.net Top

I don't' know specific situations,

but generally, if you write a code in VB and translate it to C#, then compare MSIL from both programs, you can view that they are equals!


 
 
James Kovacs





PostPosted: Visual C# General, Compa Thread performance in C# and vb.net Top

In my experience, the VB.NET and C# compilers produce roughly equivalent MSIL from a performance perspective with similar code. (You can do silly things in VB.NET like turning off option explicit and not specifying type, thus forcing the VB.NET compiler to generate slower code. You can get similar performance from either language assuming you know how to use it properly.) If you're worried about multi-threading, both languages use the threading constructs that are in the base class library (BCL). So you're not going to see any difference there. Regardless of which language you're using, you would be better served looking for algorithmic optimizations in your code than translating from one managed language to another.