Probably a silly Q (C++ .dlls in .NET)

wyrd

Well-known member
Joined
Aug 23, 2002
Messages
1,408
Location
California
I have a .. well, silly question. :)

If you program something in C/C++ and compile that into a .dll for use in your .NET program, will the code run faster then say programming that same thing in .NET and compiling that into .dll?

Basically it breaks down to C/C++ .dlls vs. .NET .dlls. Common sense to me would say that the code in the C/C++ .dlls would run faster (not by much, though) and thus make your .NET app run faster. But, I dont know how .NET compiles .dll files in comparison to C/C++ so..

Yeah, I know silly question. Come to think of it, instead of asking I probably should just run some benchmark tests of my own. :eek: But regardless of that Im searching for possibly more of a technical answer (as to why they run the same speed or one is faster and how .NET compiles .dlls)
 
It depends whether youre writing managed C++ code or unmanaged. With managed youll get the advantages of the JIT compiler which can give results either slower or faster than natively compiled code, depending on application. If youre writing unmanaged code the only slowdowns could be marshalling to/from it if youre calling it repeatedly.
 
Back
Top