Is C++/CLI faster than C#

Not necessarily. However, C++/CLI takes away much of the syntactic sugar around non-performant ways of doing things that is present in C# (boxing for example).

Also, C++/CLI allows you a much more clean interop with unmanaged code, actually allowing you to mix managed / unmanaged code, which is a performance crucial environment may be of benifit.

EDIT:

See this post for some of the differences: http://msdn.microsoft.com/en-us/library/ms379617(VS.80).aspx


Since they both run on the .NET framework, I'd say any performance difference would be negligable. Any difference will almost certainly be down to how well whichever compilers you are using work.


Well, the short answer is no. Why? Reference types in C++/CLI are compiled to MSIL, same as in C#.

The nice thing about C++/CLI (and the long answer) though, is that you can easily call into native code, which (in many cases) is faster. That being said, if you write a native C++ class and expect it to be executed natively when called by someone in a managed class, that native C++ class must be compiled without CLR support (this question goes into how to do that).

Tags:

C#

C++ Cli