Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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 don't 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 I'm 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)

Gamer extraordinaire. Programmer wannabe.
  • *Gurus*
Posted
It depends whether you're writing managed C++ code or unmanaged. With managed you'll get the advantages of the JIT compiler which can give results either slower or faster than natively compiled code, depending on application. If you're writing unmanaged code the only slowdowns could be marshalling to/from it if you're calling it repeatedly.

MVP, Visual Developer - .NET

 

Now you see why evil will always triumph - because good is dumb.

 

My free .NET Windows Forms Controls and Articles

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...