By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,641 Members | 2,101 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,641 IT Pros & Developers. It's quick & easy.

CLI Marshaling

P: n/a
Hi

I am about to write a performance crutial system, I am considering writing this system based on native COM or unmanaged C++ exposed as CLI, Now, I Wonder... does exposing a native code through CLI ( using a mixed mode DLL ) have any performance penalty? consider one Native C++ CLI assembly calling a methos od another CLI Native C++ Assembly, will there be any marshaling penalty, will there be any penelty at-all? is it possible to pass a direct memory pointer ( e.g, BSTR ) from one Native CLI to the other with no marshaling

Nadav.
Nov 16 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Nadav,

It should be pointed out that there is no such thing as "native COM".
COM is an interface-based architecture which doesn't have a native
implementation (although the implementation and use in some languages is
easier than others).

There is always going to be a performance penalty for marshaling
unmanaged data to the managed realm. While you can marshal memory pointers
(IntPtr is really good at this), if you want to do anything meaningful on
the other side of the managed/unmanaged boundary, you are going to have to
perform some sort of operation (which is always going to take time).

If you are looking for the best performance, your best bet is to remain
in one arena, either managed, or unmanaged, and stick to it.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Nadav" <an*******@discussions.microsoft.com> wrote in message
news:70**********************************@microsof t.com...
Hi,

I am about to write a performance crutial system, I am considering writing this system based on native COM or unmanaged C++ exposed as CLI, Now, I
Wonder... does exposing a native code through CLI ( using a mixed mode DLL )
have any performance penalty? consider one Native C++ CLI assembly calling a
methos od another CLI Native C++ Assembly, will there be any marshaling
penalty, will there be any penelty at-all? is it possible to pass a direct
memory pointer ( e.g, BSTR ) from one Native CLI to the other with no
marshaling?
Nadav.

Nov 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.