MarshalByRefObject vs Marshal by value in performence c#
I have big data structure that I pass between two application domains. What way of transporting do you propose MarshalByRefObject
vs Marshal
by value?
Thank you!
The difference between the two is that Marshal by value copies the entire object across application domain boundaries; with MarshalByRefObject, you are effectively sharing the object between the domains as a reference (see the specifics on MSDN).
Therefore, if objects are large, and performance is an issue, MarshalByRefObject will probably be the best way to go.
精彩评论